diff --git a/examples/demo01.gv b/examples/demo01.gv index be6313a1f..fb0864cf0 100644 --- a/examples/demo01.gv +++ b/examples/demo01.gv @@ -1,186 +1,266 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
D-Subfemale9-pin
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DCD1
RX2
TX3
DTR4
GND5
DSR6
RTS7
CTS8
RI9
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
D-Subfemale9-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
DCD1
RX2
TX3
DTR4
GND5
DSR6
RTS7
CTS8
RI9
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] - X1:p7r:e -- X1:p8r:e +> shape=box style=filled] + edge [color="#000000"] + X1:p7r:e -- X1:p8r:e [label=" " color="#000000" noLabel=noLabel] X2 [label=< - - - - +
- - -
X2
-
- - - - -
Molex KK 254female3-pin
-
- - - - - - - - - - - - - -
1GND
2RX
3TX
-
+ + + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female3-pin
+
+ + + + + [] + + + + + [] + + + + + [] + +
1GND
2RX
3TX
+
+> shape=box style=filled] + W1 [label=< + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + + +
3x0.25 mm²+ S0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:5:GND 1:WH X2:1:GND
+ + + + + + + + + + +
+
X1:2:RX 2:BN X2:3:TX
+ + + + + + + + + + +
+
X1:3:TX 3:GN X2:2:RX
+ + + + + + + + + + +
+
 
X1:5:GND Shield
+ + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + edge [color="#000000:#FFFFFF:#000000"] X1:p5r:e -- W1:w1:w W1:w1:e -- X2:p1l:w edge [color="#000000:#895956:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p3l:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] X1:p3r:e -- W1:w3:w W1:w3:e -- X2:p2l:w edge [color="#000000"] - X1:p5r:e -- W1:ws:w - W1 [label=< - - - - -
- - -
W1
-
- - - - - -
3x0.25 mm²+ S0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:5:GND - 1:WH - X2:1:GND
- - - - -
-
X1:2:RX - 2:BN - X2:3:TX
- - - - -
-
X1:3:TX - 3:GN - X2:2:RX
- - - - -
-
 
X1:5:GNDShield
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] + X1:p5r:e -- W1:w4:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000" straight=straight] } diff --git a/examples/demo01.html b/examples/demo01.html index 8dcb55017..c5b7de68e 100644 --- a/examples/demo01.html +++ b/examples/demo01.html @@ -1,7 +1,7 @@ - + demo01 - +

demo01

Diagram

@@ -30,181 +30,215 @@

Diagram

- - - - + + + X1 - - - -X1 - -D-Sub - -female - -9-pin - -DCD - -1 - -RX - -2 - -TX - -3 - -DTR - -4 - -GND - -5 - -DSR - -6 - -RTS - -7 - -CTS - -8 - -RI - -9 + + + +X1 + +D-Sub + +female + +9-pin + +DCD + +1 + +RX + +2 + +TX + +3 + +DTR + +4 + +GND + +5 + +DSR + +6 + +RTS + +7 + +CTS + +8 + +RI + +9 X1:e--X1:e - - - + - + W1 - - -W1 - -3x - -0.25 mm² - -+ S - -0.2 m -  -X1:5:GND -     1:WH     -X2:1:GND - - - -X1:2:RX -     2:BN     -X2:3:TX - - - -X1:3:TX -     3:GN     -X2:2:RX - - - -  -X1:5:GND -Shield - -  + + + +W1 + +3x + +0.25 mm² + ++ S + +0.2 m +  + X1:5:GND + +1:WH + +X2:1:GND + + + + X1:2:RX + +2:BN + +X2:3:TX + + + + X1:3:TX + +3:GN + +X2:2:RX + + + +  + X1:5:GND + +Shield + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - - -X2 - -Molex KK 254 - -female - -3-pin - -1 - -GND - -2 - -RX - -3 - -TX + + + +X2 + +Molex KK 254 + +female + +3-pin + +1 + +GND + +2 + +RX + +3 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + @@ -220,33 +254,33 @@

Bill of Materials

- - + + - - - - - - - - - + + - - + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, 3 x 0.25 mm² shielded0.2mW1
2Connector, D-Sub, female, 9 pins1 1 Connector, D-Sub, female, 9 pins X1
3Connector, Molex KK 254, female, 3 pins2 1 Connector, Molex KK 254, female, 3 pins X2
31mCable, 3 x 0.25 mm² shieldedW1
diff --git a/examples/demo01.png b/examples/demo01.png index 179147d40..ba261aaf4 100644 Binary files a/examples/demo01.png and b/examples/demo01.png differ diff --git a/examples/demo01.svg b/examples/demo01.svg index 03b2a4bf3..d3a6e70c9 100644 --- a/examples/demo01.svg +++ b/examples/demo01.svg @@ -1,181 +1,215 @@ - - - - + + + X1 - - - -X1 - -D-Sub - -female - -9-pin - -DCD - -1 - -RX - -2 - -TX - -3 - -DTR - -4 - -GND - -5 - -DSR - -6 - -RTS - -7 - -CTS - -8 - -RI - -9 + + + +X1 + +D-Sub + +female + +9-pin + +DCD + +1 + +RX + +2 + +TX + +3 + +DTR + +4 + +GND + +5 + +DSR + +6 + +RTS + +7 + +CTS + +8 + +RI + +9 X1:e--X1:e - - - + - + W1 - - -W1 - -3x - -0.25 mm² - -+ S - -0.2 m -  -X1:5:GND -     1:WH     -X2:1:GND - - - -X1:2:RX -     2:BN     -X2:3:TX - - - -X1:3:TX -     3:GN     -X2:2:RX - - - -  -X1:5:GND -Shield - -  + + + +W1 + +3x + +0.25 mm² + ++ S + +0.2 m +  + X1:5:GND + +1:WH + +X2:1:GND + + + + X1:2:RX + +2:BN + +X2:3:TX + + + + X1:3:TX + +3:GN + +X2:2:RX + + + +  + X1:5:GND + +Shield + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - - -X2 - -Molex KK 254 - -female - -3-pin - -1 - -GND - -2 - -RX - -3 - -TX + + + +X2 + +Molex KK 254 + +female + +3-pin + +1 + +GND + +2 + +RX + +3 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/examples/demo01.tsv b/examples/demo01.tsv new file mode 100644 index 000000000..fef6d9747 --- /dev/null +++ b/examples/demo01.tsv @@ -0,0 +1,4 @@ +# Qty Unit Description Designators +1 1 Connector, D-Sub, female, 9 pins X1 +2 1 Connector, Molex KK 254, female, 3 pins X2 +3 1 m Cable, 3 x 0.25 mm² shielded W1 diff --git a/examples/demo01.yml b/examples/demo01.yml index d5ed3ef23..857bed8bf 100644 --- a/examples/demo01.yml +++ b/examples/demo01.yml @@ -7,7 +7,7 @@ connectors: subtype: female pinlabels: [DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI] loops: - - [7,8] + L1: [7,8] X2: type: Molex KK 254 subtype: female diff --git a/examples/demo01_wv_gvpr.gvpr b/examples/demo01_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/demo01_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/demo02.gv b/examples/demo02.gv index ed8dd8117..ab728062e 100644 --- a/examples/demo02.gv +++ b/examples/demo02.gv @@ -1,549 +1,784 @@ graph { -// Graph generated by WireViz 0.4-dev +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
Molex KK 254female8-pin
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GND1
+5V2
SCL3
SDA4
MISO5
MOSI6
SCK7
N/C8
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex KK 254female8-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
GND1
+5V2
SCL3
SDA4
MISO5
MOSI6
SCK7
N/C8
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
1GND
2+5V
3SCL
4SDA
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2+5V
3SCL
4SDA
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X3 [label=< - - - - +
- - -
X3
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
1GND
2+5V
3SCL
4SDA
-
+ + + + + + + + +
+ + + + +
X3
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2+5V
3SCL
4SDA
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X4 [label=< - - - - +
- - -
X4
-
- - - - -
Molex KK 254female5-pin
-
- - - - - - - - - - - - - - - - - - - - - -
1GND
2+12V
3MISO
4MOSI
5SCK
-
+ + + + + + + + +
+ + + + +
X4
+
+ + + + + + +
Molex KK 254female5-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2+12V
3MISO
4MOSI
5SCK
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_1 [label=< - - +
- - - - - -
Crimp ferrule0.25 mm²YE
-
+ + +
+ + + + + + + +
Crimp ferrule0.25 mm²YE
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_2 [label=< - - +
- - - - - -
Crimp ferrule0.25 mm²YE
-
+ + +
+ + + + + + + +
Crimp ferrule0.25 mm²YE
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
4x0.14 mm² (26 AWG)0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND BK X2:1:GND
+ + + + + + + + + + +
+
X1:2:+5V RD X2:2:+5V
+ + + + + + + + + + +
+
X1:3:SCL YE X2:3:SCL
+ + + + + + + + + + +
+
X1:4:SDA GN X2:4:SDA
+ + + + + + + + + + +
+
 
+
+> shape=box style="filled,dashed"] edge [color="#000000:#000000:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X1:p3r:e -- W1:w3:w W1:w3:e -- X2:p3l:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w - W1 [label=< - - - - + W1:w1:e -- W1:w1:w [color="#000000:#000000:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#00AA00:#000000" straight=straight] + W2 [label=< +
- - -
W1
-
- - - - -
4x0.14 mm² (26 AWG)0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - BK - X2:1:GND
- - - - -
-
X1:2:+5V - RD - X2:2:+5V
- - - - -
-
X1:3:SCL - YE - X2:3:SCL
- - - - -
-
X1:4:SDA - GN - X2:4:SDA
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W2
+
+ + + + + + +
4x0.14 mm² (26 AWG)0.4 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND BK X3:1:GND
+ + + + + + + + + + +
+
X1:2:+5V RD X3:2:+5V
+ + + + + + + + + + +
+
X1:3:SCL YE X3:3:SCL
+ + + + + + + + + + +
+
X1:4:SDA GN X3:4:SDA
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] +> shape=box style="filled,dashed"] edge [color="#000000:#000000:#000000"] X1:p1r:e -- W2:w1:w W2:w1:e -- X3:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W2:w2:w W2:w2:e -- X3:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X1:p3r:e -- W2:w3:w W2:w3:e -- X3:p3l:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] X1:p4r:e -- W2:w4:w W2:w4:e -- X3:p4l:w - W2 [label=< - - - - + W2:w1:e -- W2:w1:w [color="#000000:#000000:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#00AA00:#000000" straight=straight] + W3 [label=< +
- - -
W2
-
- - - - -
4x0.14 mm² (26 AWG)0.4 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - BK - X3:1:GND
- - - - -
-
X1:2:+5V - RD - X3:2:+5V
- - - - -
-
X1:3:SCL - YE - X3:3:SCL
- - - - -
-
X1:4:SDA - GN - X3:4:SDA
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W3
+
+ + + + + + +
4x0.14 mm² (26 AWG)0.3 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND BK X4:1:GND
+ + + + + + + + + + +
+
X1:5:MISO BU X4:3:MISO
+ + + + + + + + + + +
+
X1:6:MOSI OG X4:4:MOSI
+ + + + + + + + + + +
+
X1:7:SCK VT X4:5:SCK
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] +> shape=box style="filled,dashed"] edge [color="#000000:#000000:#000000"] X1:p1r:e -- W3:w1:w W3:w1:e -- X4:p1l:w - edge [color="#000000:#0066ff:#000000"] + edge [color="#000000:#0066FF:#000000"] X1:p5r:e -- W3:w2:w W3:w2:e -- X4:p3l:w - edge [color="#000000:#ff8000:#000000"] + edge [color="#000000:#FF8000:#000000"] X1:p6r:e -- W3:w3:w W3:w3:e -- X4:p4l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X1:p7r:e -- W3:w4:w W3:w4:e -- X4:p5l:w - W3 [label=< - - - - + W3:w1:e -- W3:w1:w [color="#000000:#000000:#000000" straight=straight] + W3:w2:e -- W3:w2:w [color="#000000:#0066FF:#000000" straight=straight] + W3:w3:e -- W3:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W3:w4:e -- W3:w4:w [color="#000000:#8000FF:#000000" straight=straight] + W4 [label=< +
- - -
W3
-
- - - - -
4x0.14 mm² (26 AWG)0.3 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - BK - X4:1:GND
- - - - -
-
X1:5:MISO - BU - X4:3:MISO
- - - - -
-
X1:6:MOSI - OG - X4:4:MOSI
- - - - -
-
X1:7:SCK - VT - X4:5:SCK
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W4
+
+ + + + + + +
2x0.25 mm² (24 AWG)0.3 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
1:BK X4:1:GND
+ + + + + + + + + + +
+
2:RD X4:2:+12V
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] +> shape=box style=filled] edge [color="#000000:#000000:#000000"] AUTOGENERATED_F_1:e -- W4:w1:w W4:w1:e -- X4:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] AUTOGENERATED_F_2:e -- W4:w2:w W4:w2:e -- X4:p2l:w - W4 [label=< - - - - -
- - -
W4
-
- - - - -
2x0.25 mm² (24 AWG)0.3 m
-
- - - - - - - - - - - - - - - - - - - -
 
- 1:BK - X4:1:GND
- - - - -
-
- 2:RD - X4:2:+12V
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] + W4:w1:e -- W4:w1:w [color="#000000:#000000:#000000" straight=straight] + W4:w2:e -- W4:w2:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/examples/demo02.html b/examples/demo02.html index 8fe7c4721..34eb7b8e4 100644 --- a/examples/demo02.html +++ b/examples/demo02.html @@ -3,12 +3,12 @@ - + WireViz Demo 2 - +

ex01

Diagram

@@ -30,178 +30,225 @@

Diagram

- - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -RX - -3 - -TX - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 - + W1 - - -W1 - -Serial - -4x - -0.25 mm² (24 AWG) - -+ S - -0.2 m -  -X1:1:GND -     1:BN     -X2:1:GND - - - -X1:2:VCC -     2:RD     -X2:2:VCC - - - -X1:3:RX -     3:OG     -X2:4:TX - - - -X1:4:TX -     4:YE     -X2:3:RX - - - -  -X1:1:GND -Shield - -  + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BN + +X2:1:GND + + + + X1:2:VCC + +2:RD + +X2:2:VCC + + + + X1:3:RX + +3:OG + +X2:4:TX + + + + X1:4:TX + +4:YE + +X2:3:RX + + + +  + X1:1:GND + +Shield + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -RX - -4 - -TX + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + @@ -217,26 +264,26 @@

Bill of Materials

- - + + - - - - - - - - - + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, Serial, 4 x 0.25 mm² shielded0.2mW1
2Connector, Molex KK 254, female, 4 pins1 2 Connector, Molex KK 254, female, 4 pins X1, X2
21mCable, Serial, 4 x 0.25 mm² shieldedW1
diff --git a/examples/ex01.png b/examples/ex01.png index c97f996e7..9b2ba898a 100644 Binary files a/examples/ex01.png and b/examples/ex01.png differ diff --git a/examples/ex01.svg b/examples/ex01.svg index 4667ae539..bc80ee87e 100644 --- a/examples/ex01.svg +++ b/examples/ex01.svg @@ -1,178 +1,225 @@ - - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -RX - -3 - -TX - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 - + W1 - - -W1 - -Serial - -4x - -0.25 mm² (24 AWG) - -+ S - -0.2 m -  -X1:1:GND -     1:BN     -X2:1:GND - - - -X1:2:VCC -     2:RD     -X2:2:VCC - - - -X1:3:RX -     3:OG     -X2:4:TX - - - -X1:4:TX -     4:YE     -X2:3:RX - - - -  -X1:1:GND -Shield - -  + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BN + +X2:1:GND + + + + X1:2:VCC + +2:RD + +X2:2:VCC + + + + X1:3:RX + +3:OG + +X2:4:TX + + + + X1:4:TX + +4:YE + +X2:3:RX + + + +  + X1:1:GND + +Shield + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -RX - -4 - -TX + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/examples/ex01.tsv b/examples/ex01.tsv new file mode 100644 index 000000000..b768b4f85 --- /dev/null +++ b/examples/ex01.tsv @@ -0,0 +1,3 @@ +# Qty Unit Description Designators +1 2 Connector, Molex KK 254, female, 4 pins X1, X2 +2 1 m Cable, Serial, 4 x 0.25 mm² shielded W1 diff --git a/examples/ex01_wv_gvpr.gvpr b/examples/ex01_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex01_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex02.gv b/examples/ex02.gv index 3f6f86342..31266aaed 100644 --- a/examples/ex02.gv +++ b/examples/ex02.gv @@ -1,299 +1,431 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
Molex Micro-Fitmale2-pin
-
- - - - - - - - - -
GND1
VCC2
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex Micro-Fitmale2-pin
+
+ + + + [] + + + + + [] + + +
GND1
VCC2
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - -
Molex Micro-Fitfemale2-pin
-
- - - - - - - - - -
1GND
2VCC
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex Micro-Fitfemale2-pin
+
+ + + + + [] + + + + + [] + +
1GND
2VCC
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X3 [label=< - - - - +
- - -
X3
-
- - - - -
Molex Micro-Fitfemale2-pin
-
- - - - - - - - - -
1GND
2VCC
-
+ + + + + + + + +
+ + + + +
X3
+
+ + + + + + +
Molex Micro-Fitfemale2-pin
+
+ + + + + [] + + + + + [] + +
1GND
2VCC
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X4 [label=< - - - - +
- - -
X4
-
- - - - -
Molex Micro-Fitfemale2-pin
-
- - - - - - - - - -
1GND
2VCC
-
+ + + + + + + + +
+ + + + +
X4
+
+ + + + + + +
Molex Micro-Fitfemale2-pin
+
+ + + + + [] + + + + + [] + +
1GND
2VCC
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
2x0.25 mm² (24 AWG)0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND 1:BK X2:1:GND
+ + + + + + + + + + +
+
X1:2:VCC 2:RD X2:2:VCC
+ + + + + + + + + + +
+
 
+
+> shape=box style=filled] edge [color="#000000:#000000:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w - W1 [label=< - - - - + W1:w1:e -- W1:w1:w [color="#000000:#000000:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W2 [label=< +
- - -
W1
-
- - - - -
2x0.25 mm² (24 AWG)0.2 m
-
- - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - 1:BK - X2:1:GND
- - - - -
-
X1:2:VCC - 2:RD - X2:2:VCC
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W2
+
+ + + + + + +
2x0.25 mm² (24 AWG)0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND 1:BK X3:1:GND
+ + + + + + + + + + +
+
X1:2:VCC 2:RD X3:2:VCC
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] edge [color="#000000:#000000:#000000"] X1:p1r:e -- W2:w1:w W2:w1:e -- X3:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W2:w2:w W2:w2:e -- X3:p2l:w - W2 [label=< - - - - + W2:w1:e -- W2:w1:w [color="#000000:#000000:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W3 [label=< +
- - -
W2
-
- - - - -
2x0.25 mm² (24 AWG)0.2 m
-
- - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - 1:BK - X3:1:GND
- - - - -
-
X1:2:VCC - 2:RD - X3:2:VCC
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W3
+
+ + + + + + +
2x20 awg (0.75 mm²)0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND 1:BK X4:1:GND
+ + + + + + + + + + +
+
X1:2:VCC 2:RD X4:2:VCC
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] edge [color="#000000:#000000:#000000"] X1:p1r:e -- W3:w1:w W3:w1:e -- X4:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W3:w2:w W3:w2:e -- X4:p2l:w - W3 [label=< - - - - -
- - -
W3
-
- - - - -
2x20 AWG (0.75 mm²)0.2 m
-
- - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - 1:BK - X4:1:GND
- - - - -
-
X1:2:VCC - 2:RD - X4:2:VCC
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] + W3:w1:e -- W3:w1:w [color="#000000:#000000:#000000" straight=straight] + W3:w2:e -- W3:w2:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/examples/ex02.html b/examples/ex02.html index 2a123e44b..9ae0af627 100644 --- a/examples/ex02.html +++ b/examples/ex02.html @@ -1,7 +1,7 @@ - + ex02 - +

ex02

Diagram

@@ -30,261 +30,322 @@

Diagram

- - - - + + + X1 - - -X1 - -Molex Micro-Fit - -male - -2-pin - -GND - -1 - -VCC - -2 + + + +X1 + +Molex Micro-Fit + +male + +2-pin + +GND + +1 + +VCC + +2 - + W1 - - -W1 - -2x - -0.25 mm² (24 AWG) - -0.2 m -  -X1:1:GND -     1:BK     -X2:1:GND - - - -X1:2:VCC -     2:RD     -X2:2:VCC - - - -  + + + +W1 + +2x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +1:BK + +X2:1:GND + + + + X1:2:VCC + +2:RD + +X2:2:VCC + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + W2 - - -W2 - -2x - -0.25 mm² (24 AWG) - -0.2 m -  -X1:1:GND -     1:BK     -X3:1:GND - - - -X1:2:VCC -     2:RD     -X3:2:VCC - - - -  + + + +W2 + +2x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +1:BK + +X3:1:GND + + + + X1:2:VCC + +2:RD + +X3:2:VCC + + + +  - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + W3 - - -W3 - -2x - -20 AWG (0.75 mm²) - -0.2 m -  -X1:1:GND -     1:BK     -X4:1:GND - - - -X1:2:VCC -     2:RD     -X4:2:VCC - - - -  + + + +W3 + +2x + +20 awg (0.75 mm²) + +0.2 m +  + X1:1:GND + +1:BK + +X4:1:GND + + + + X1:2:VCC + +2:RD + +X4:2:VCC + + + +  - + X1:e--W3:w - - - + + + - + X1:e--W3:w - - - + + + - - -X2 - - -X2 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X3 - - -X3 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X4 - - -X4 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +X2 + + + +X2 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +X3 + + + +X3 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +X4 + + + +X4 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W3:e--X4:w - - - + + + - + W3:e--X4:w - - - + + + @@ -300,40 +361,40 @@

Bill of Materials

- - + + - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, 2 x 0.25 mm²0.4mW1, W2
2Cable, 2 x 20 AWG0.2mW3
3Connector, Molex Micro-Fit, female, 2 pins1 3 Connector, Molex Micro-Fit, female, 2 pins X2, X3, X4
4Connector, Molex Micro-Fit, male, 2 pins2 1 Connector, Molex Micro-Fit, male, 2 pins X1
32mCable, 2 x 0.25 mm²W1, W2
41mCable, 2 x 20 awgW3
diff --git a/examples/ex02.png b/examples/ex02.png index e1224b789..99b3ee281 100644 Binary files a/examples/ex02.png and b/examples/ex02.png differ diff --git a/examples/ex02.svg b/examples/ex02.svg index cb86958c3..6ecc706d7 100644 --- a/examples/ex02.svg +++ b/examples/ex02.svg @@ -1,261 +1,322 @@ - - - - + + + X1 - - -X1 - -Molex Micro-Fit - -male - -2-pin - -GND - -1 - -VCC - -2 + + + +X1 + +Molex Micro-Fit + +male + +2-pin + +GND + +1 + +VCC + +2 - + W1 - - -W1 - -2x - -0.25 mm² (24 AWG) - -0.2 m -  -X1:1:GND -     1:BK     -X2:1:GND - - - -X1:2:VCC -     2:RD     -X2:2:VCC - - - -  + + + +W1 + +2x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +1:BK + +X2:1:GND + + + + X1:2:VCC + +2:RD + +X2:2:VCC + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + W2 - - -W2 - -2x - -0.25 mm² (24 AWG) - -0.2 m -  -X1:1:GND -     1:BK     -X3:1:GND - - - -X1:2:VCC -     2:RD     -X3:2:VCC - - - -  + + + +W2 + +2x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +1:BK + +X3:1:GND + + + + X1:2:VCC + +2:RD + +X3:2:VCC + + + +  - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + W3 - - -W3 - -2x - -20 AWG (0.75 mm²) - -0.2 m -  -X1:1:GND -     1:BK     -X4:1:GND - - - -X1:2:VCC -     2:RD     -X4:2:VCC - - - -  + + + +W3 + +2x + +20 awg (0.75 mm²) + +0.2 m +  + X1:1:GND + +1:BK + +X4:1:GND + + + + X1:2:VCC + +2:RD + +X4:2:VCC + + + +  - + X1:e--W3:w - - - + + + - + X1:e--W3:w - - - + + + - - -X2 - - -X2 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X3 - - -X3 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X4 - - -X4 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +X2 + + + +X2 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +X3 + + + +X3 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +X4 + + + +X4 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W3:e--X4:w - - - + + + - + W3:e--X4:w - - - + + + diff --git a/examples/ex02.tsv b/examples/ex02.tsv new file mode 100644 index 000000000..851dfdb1d --- /dev/null +++ b/examples/ex02.tsv @@ -0,0 +1,5 @@ +# Qty Unit Description Designators +1 3 Connector, Molex Micro-Fit, female, 2 pins X2, X3, X4 +2 1 Connector, Molex Micro-Fit, male, 2 pins X1 +3 2 m Cable, 2 x 0.25 mm² W1, W2 +4 1 m Cable, 2 x 20 awg W3 diff --git a/examples/ex02_wv_gvpr.gvpr b/examples/ex02_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex02_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex03.gv b/examples/ex03.gv index a69e3038a..d5612d0ce 100644 --- a/examples/ex03.gv +++ b/examples/ex03.gv @@ -1,255 +1,365 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
Molex Micro-Fitmale2-pin
-
- - - - - - - - - -
GND1
VCC2
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex Micro-Fitmale2-pin
+
+ + + + [] + + + + + [] + + +
GND1
VCC2
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - -
Molex Micro-Fitfemale2-pin
-
- - - - - - - - - -
1GND
2VCC
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex Micro-Fitfemale2-pin
+
+ + + + + [] + + + + + [] + +
1GND
2VCC
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X3 [label=< - - - - +
- - -
X3
-
- - - - -
Molex Micro-Fitfemale2-pin
-
- - - - - - - - - -
1GND
2VCC
-
+ + + + + + + + +
+ + + + +
X3
+
+ + + + + + +
Molex Micro-Fitfemale2-pin
+
+ + + + + [] + + + + + [] + +
1GND
2VCC
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X4 [label=< - - - - +
- - -
X4
-
- - - - -
Molex Micro-Fitfemale2-pin
-
- - - - - - - - - -
1GND
2VCC
-
+ + + + + + + + +
+ + + + +
X4
+
+ + + + + + +
Molex Micro-Fitfemale2-pin
+
+ + + + + [] + + + + + [] + +
1GND
2VCC
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
6x0.25 mm² (24 AWG)0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND BK X2:1:GND
+ + + + + + + + + + +
+
X1:2:VCC RD X2:2:VCC
+ + + + + + + + + + +
+
X1:1:GND BK X3:1:GND
+ + + + + + + + + + +
+
X1:2:VCC RD X3:2:VCC
+ + + + + + + + + + +
+
X1:1:GND BK X4:1:GND
+ + + + + + + + + + +
+
X1:2:VCC RD X4:2:VCC
+ + + + + + + + + + +
+
 
+
+> shape=box style="filled,dashed"] edge [color="#000000:#000000:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w edge [color="#000000:#000000:#000000"] X1:p1r:e -- W1:w3:w W1:w3:e -- X3:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W1:w4:w W1:w4:e -- X3:p2l:w edge [color="#000000:#000000:#000000"] X1:p1r:e -- W1:w5:w W1:w5:e -- X4:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W1:w6:w W1:w6:e -- X4:p2l:w - W1 [label=< - - - - -
- - -
W1
-
- - - - -
6x0.25 mm² (24 AWG)0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - BK - X2:1:GND
- - - - -
-
X1:2:VCC - RD - X2:2:VCC
- - - - -
-
X1:1:GND - BK - X3:1:GND
- - - - -
-
X1:2:VCC - RD - X3:2:VCC
- - - - -
-
X1:1:GND - BK - X4:1:GND
- - - - -
-
X1:2:VCC - RD - X4:2:VCC
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] + W1:w1:e -- W1:w1:w [color="#000000:#000000:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#000000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000:#000000:#000000" straight=straight] + W1:w6:e -- W1:w6:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/examples/ex03.html b/examples/ex03.html index 2eb8fefde..0e74ab4d6 100644 --- a/examples/ex03.html +++ b/examples/ex03.html @@ -1,7 +1,7 @@ - + ex03 - +

ex03

Diagram

@@ -30,231 +30,290 @@

Diagram

- - - - + + + X1 - - -X1 - -Molex Micro-Fit - -male - -2-pin - -GND - -1 - -VCC - -2 + + + +X1 + +Molex Micro-Fit + +male + +2-pin + +GND + +1 + +VCC + +2 - + W1 - - -W1 - -6x - -0.25 mm² (24 AWG) - -0.2 m -  -X1:1:GND -     BK     -X2:1:GND - - - -X1:2:VCC -     RD     -X2:2:VCC - - - -X1:1:GND -     BK     -X3:1:GND - - - -X1:2:VCC -     RD     -X3:2:VCC - - - -X1:1:GND -     BK     -X4:1:GND - - - -X1:2:VCC -     RD     -X4:2:VCC - - - -  + + + +W1 + +6x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +BK + +X2:1:GND + + + + X1:2:VCC + +RD + +X2:2:VCC + + + + X1:1:GND + +BK + +X3:1:GND + + + + X1:2:VCC + +RD + +X3:2:VCC + + + + X1:1:GND + +BK + +X4:1:GND + + + + X1:2:VCC + +RD + +X4:2:VCC + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - - -X2 - - -X2 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X3 - - -X3 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X4 - - -X4 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +X2 + + + +X2 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +X3 + + + +X3 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X3:w - - - + + + - + W1:e--X3:w - - - + + + + + + +X4 + + + +X4 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X4:w - - - + + + - + W1:e--X4:w - - - + + + @@ -270,38 +329,38 @@

Bill of Materials

- - + + - - + + - - + + - - - + + + - - - + + +
IdDescription# Qty UnitDescription Designators
1Connector, Molex Micro-Fit, female, 2 pins1 3 Connector, Molex Micro-Fit, female, 2 pins X2, X3, X4
2Connector, Molex Micro-Fit, male, 2 pins2 1 Connector, Molex Micro-Fit, male, 2 pins X1
3Wire, 0.25 mm², BK0.633 mWire, 0.25 mm², BK W1
4Wire, 0.25 mm², RD0.643 mWire, 0.25 mm², RD W1
diff --git a/examples/ex03.png b/examples/ex03.png index e079fa0e0..33bfd87ae 100644 Binary files a/examples/ex03.png and b/examples/ex03.png differ diff --git a/examples/ex03.svg b/examples/ex03.svg index a13b91849..f36a6c693 100644 --- a/examples/ex03.svg +++ b/examples/ex03.svg @@ -1,231 +1,290 @@ - - - - + + + X1 - - -X1 - -Molex Micro-Fit - -male - -2-pin - -GND - -1 - -VCC - -2 + + + +X1 + +Molex Micro-Fit + +male + +2-pin + +GND + +1 + +VCC + +2 - + W1 - - -W1 - -6x - -0.25 mm² (24 AWG) - -0.2 m -  -X1:1:GND -     BK     -X2:1:GND - - - -X1:2:VCC -     RD     -X2:2:VCC - - - -X1:1:GND -     BK     -X3:1:GND - - - -X1:2:VCC -     RD     -X3:2:VCC - - - -X1:1:GND -     BK     -X4:1:GND - - - -X1:2:VCC -     RD     -X4:2:VCC - - - -  + + + +W1 + +6x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +BK + +X2:1:GND + + + + X1:2:VCC + +RD + +X2:2:VCC + + + + X1:1:GND + +BK + +X3:1:GND + + + + X1:2:VCC + +RD + +X3:2:VCC + + + + X1:1:GND + +BK + +X4:1:GND + + + + X1:2:VCC + +RD + +X4:2:VCC + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - - -X2 - - -X2 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X3 - - -X3 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X4 - - -X4 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +X2 + + + +X2 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +X3 + + + +X3 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X3:w - - - + + + - + W1:e--X3:w - - - + + + + + + +X4 + + + +X4 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X4:w - - - + + + - + W1:e--X4:w - - - + + + diff --git a/examples/ex03.tsv b/examples/ex03.tsv new file mode 100644 index 000000000..392753ac8 --- /dev/null +++ b/examples/ex03.tsv @@ -0,0 +1,5 @@ +# Qty Unit Description Designators +1 3 Connector, Molex Micro-Fit, female, 2 pins X2, X3, X4 +2 1 Connector, Molex Micro-Fit, male, 2 pins X1 +3 3 m Wire, 0.25 mm², BK W1 +4 3 m Wire, 0.25 mm², RD W1 diff --git a/examples/ex03_wv_gvpr.gvpr b/examples/ex03_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex03_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex04.gv b/examples/ex04.gv index 6fe03f54e..8a12222ba 100644 --- a/examples/ex04.gv +++ b/examples/ex04.gv @@ -1,251 +1,361 @@ graph { -// Graph generated by WireViz 0.4-dev +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] AUTOGENERATED_F_1 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_2 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_3 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_4 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_5 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_6 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_7 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_8 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_9 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_10 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_11 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_12 [label=< - - +
- - -
Crimp ferrule
-
+ + +
+ + + + +
Crimp ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
6x0.25 mm² (24 AWG)0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
BN
+ + + + + + + + + + +
+
RD
+ + + + + + + + + + +
+
OG
+ + + + + + + + + + +
+
YE
+ + + + + + + + + + +
+
GN
+ + + + + + + + + + +
+
BU
+ + + + + + + + + + +
+
 
+
+> shape=box style="filled,dashed"] edge [color="#000000:#895956:#000000"] AUTOGENERATED_F_1:e -- W1:w1:w W1:w1:e -- AUTOGENERATED_F_7:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] AUTOGENERATED_F_2:e -- W1:w2:w W1:w2:e -- AUTOGENERATED_F_8:w - edge [color="#000000:#ff8000:#000000"] + edge [color="#000000:#FF8000:#000000"] AUTOGENERATED_F_3:e -- W1:w3:w W1:w3:e -- AUTOGENERATED_F_9:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] AUTOGENERATED_F_4:e -- W1:w4:w W1:w4:e -- AUTOGENERATED_F_10:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] AUTOGENERATED_F_5:e -- W1:w5:w W1:w5:e -- AUTOGENERATED_F_11:w - edge [color="#000000:#0066ff:#000000"] + edge [color="#000000:#0066FF:#000000"] AUTOGENERATED_F_6:e -- W1:w6:w W1:w6:e -- AUTOGENERATED_F_12:w - W1 [label=< - - - - -
- - -
W1
-
- - - - -
6x0.25 mm² (24 AWG)0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- BN -
- - - - -
-
- RD -
- - - - -
-
- OG -
- - - - -
-
- YE -
- - - - -
-
- GN -
- - - - -
-
- BU -
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] + W1:w1:e -- W1:w1:w [color="#000000:#895956:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w6:e -- W1:w6:w [color="#000000:#0066FF:#000000" straight=straight] } diff --git a/examples/ex04.html b/examples/ex04.html index cd0d4a41c..2d09196ce 100644 --- a/examples/ex04.html +++ b/examples/ex04.html @@ -1,7 +1,7 @@ - + ex04 - +

ex04

Diagram

@@ -30,219 +30,298 @@

Diagram

- - - - + + + AUTOGENERATED_F_1 - - -Crimp ferrule + + + +Crimp ferrule - + W1 - - -W1 - -6x - -0.25 mm² (24 AWG) - -0.2 m -  -     BN     - - - -     RD     - - - -     OG     - - - -     YE     - - - -     GN     - - - -     BU     - - - -  + + + +W1 + +6x + +0.25 mm² (24 AWG) + +0.2 m +  + + +BN + + + + + + + +RD + + + + + + + +OG + + + + + + + +YE + + + + + + + +GN + + + + + + + +BU + + + + + +  AUTOGENERATED_F_1:e--W1:w - - - + + + - - -AUTOGENERATED_F_2 - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_2:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F_3 - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_3:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F_4 - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_4:e--W1:w - - - - - - -AUTOGENERATED_F_5 - - -Crimp ferrule - - - -AUTOGENERATED_F_5:e--W1:w - - - - - - -AUTOGENERATED_F_6 - - -Crimp ferrule - - - -AUTOGENERATED_F_6:e--W1:w - - - +W1:e--W1:w + + + - + AUTOGENERATED_F_7 - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_7:w + + + - + AUTOGENERATED_F_8 - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_8:w + + + - + AUTOGENERATED_F_9 - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_9:w + + + - + AUTOGENERATED_F_10 - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_10:w + + + - + AUTOGENERATED_F_11 - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_11:w + + + - + AUTOGENERATED_F_12 - - -Crimp ferrule + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_7:w - - - + + +W1:e--AUTOGENERATED_F_12:w + + + - - -W1:e--AUTOGENERATED_F_8:w - - - + + +AUTOGENERATED_F_2 + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_9:w - - - + + +AUTOGENERATED_F_2:e--W1:w + + + - - -W1:e--AUTOGENERATED_F_10:w - - - + + +AUTOGENERATED_F_3 + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_11:w - - - + + +AUTOGENERATED_F_3:e--W1:w + + + - - -W1:e--AUTOGENERATED_F_12:w - - - + + +AUTOGENERATED_F_4 + + + +Crimp ferrule + + + +AUTOGENERATED_F_4:e--W1:w + + + + + + +AUTOGENERATED_F_5 + + + +Crimp ferrule + + + +AUTOGENERATED_F_5:e--W1:w + + + + + + +AUTOGENERATED_F_6 + + + +Crimp ferrule + + + +AUTOGENERATED_F_6:e--W1:w + + + @@ -258,59 +337,59 @@

Bill of Materials

- - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + +
IdDescription# Qty UnitDescription Designators
1Connector, Crimp ferrule1 12 Connector, Crimp ferrule
2Wire, 0.25 mm², BN0.221 mWire, 0.25 mm², BN W1
3Wire, 0.25 mm², BU0.231 mWire, 0.25 mm², BU W1
4Wire, 0.25 mm², GN0.241 mWire, 0.25 mm², GN W1
5Wire, 0.25 mm², OG0.251 mWire, 0.25 mm², OG W1
6Wire, 0.25 mm², RD0.261 mWire, 0.25 mm², RD W1
7Wire, 0.25 mm², YE0.271 mWire, 0.25 mm², YE W1
diff --git a/examples/ex04.png b/examples/ex04.png index 601281eb6..55d6c26bf 100644 Binary files a/examples/ex04.png and b/examples/ex04.png differ diff --git a/examples/ex04.svg b/examples/ex04.svg index fe8bb9326..16322a30d 100644 --- a/examples/ex04.svg +++ b/examples/ex04.svg @@ -1,219 +1,298 @@ - - - - + + + AUTOGENERATED_F_1 - - -Crimp ferrule + + + +Crimp ferrule - + W1 - - -W1 - -6x - -0.25 mm² (24 AWG) - -0.2 m -  -     BN     - - - -     RD     - - - -     OG     - - - -     YE     - - - -     GN     - - - -     BU     - - - -  + + + +W1 + +6x + +0.25 mm² (24 AWG) + +0.2 m +  + + +BN + + + + + + + +RD + + + + + + + +OG + + + + + + + +YE + + + + + + + +GN + + + + + + + +BU + + + + + +  AUTOGENERATED_F_1:e--W1:w - - - + + + - - -AUTOGENERATED_F_2 - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_2:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F_3 - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_3:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F_4 - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_4:e--W1:w - - - - - - -AUTOGENERATED_F_5 - - -Crimp ferrule - - - -AUTOGENERATED_F_5:e--W1:w - - - - - - -AUTOGENERATED_F_6 - - -Crimp ferrule - - - -AUTOGENERATED_F_6:e--W1:w - - - +W1:e--W1:w + + + - + AUTOGENERATED_F_7 - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_7:w + + + - + AUTOGENERATED_F_8 - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_8:w + + + - + AUTOGENERATED_F_9 - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_9:w + + + - + AUTOGENERATED_F_10 - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_10:w + + + - + AUTOGENERATED_F_11 - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_11:w + + + - + AUTOGENERATED_F_12 - - -Crimp ferrule + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_7:w - - - + + +W1:e--AUTOGENERATED_F_12:w + + + - - -W1:e--AUTOGENERATED_F_8:w - - - + + +AUTOGENERATED_F_2 + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_9:w - - - + + +AUTOGENERATED_F_2:e--W1:w + + + - - -W1:e--AUTOGENERATED_F_10:w - - - + + +AUTOGENERATED_F_3 + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_11:w - - - + + +AUTOGENERATED_F_3:e--W1:w + + + - - -W1:e--AUTOGENERATED_F_12:w - - - + + +AUTOGENERATED_F_4 + + + +Crimp ferrule + + + +AUTOGENERATED_F_4:e--W1:w + + + + + + +AUTOGENERATED_F_5 + + + +Crimp ferrule + + + +AUTOGENERATED_F_5:e--W1:w + + + + + + +AUTOGENERATED_F_6 + + + +Crimp ferrule + + + +AUTOGENERATED_F_6:e--W1:w + + + diff --git a/examples/ex04.tsv b/examples/ex04.tsv new file mode 100644 index 000000000..86cd3cb16 --- /dev/null +++ b/examples/ex04.tsv @@ -0,0 +1,8 @@ +# Qty Unit Description Designators +1 12 Connector, Crimp ferrule +2 1 m Wire, 0.25 mm², BN W1 +3 1 m Wire, 0.25 mm², BU W1 +4 1 m Wire, 0.25 mm², GN W1 +5 1 m Wire, 0.25 mm², OG W1 +6 1 m Wire, 0.25 mm², RD W1 +7 1 m Wire, 0.25 mm², YE W1 diff --git a/examples/ex04_wv_gvpr.gvpr b/examples/ex04_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex04_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex05.gv b/examples/ex05.gv index 0f453f7e5..c8aeb64c6 100644 --- a/examples/ex05.gv +++ b/examples/ex05.gv @@ -1,317 +1,451 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
GND1
VCC2
SCL3
SDA4
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
GND1
VCC2
SCL3
SDA4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - - - - - -
1GND1
2VCC2
3SCL3
4SDA4
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + + [] + + + + + + [] + + + + + + [] + + +
1GND1
2VCC2
3SCL3
4SDA4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X3 [label=< - - - - +
- - -
X3
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
1GND
2VCC
3SCL
4SDA
-
+ + + + + + + + +
+ + + + +
X3
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2VCC
3SCL
4SDA
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ff66cc:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + + +
I2C4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND PK X2:1:GND
+ + + + + + + + + + +
+
X1:2:VCC TQ X2:2:VCC
+ + + + + + + + + + +
+
X1:3:SCL YE X2:3:SCL
+ + + + + + + + + + +
+
X1:4:SDA VT X2:4:SDA
+ + + + + + + + + + +
+
 
+
+> shape=box style="filled,dashed"] + edge [color="#000000:#FF66CC:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w - edge [color="#000000:#00ffff:#000000"] + edge [color="#000000:#00FFFF:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X1:p3r:e -- W1:w3:w W1:w3:e -- X2:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w - W1 [label=< - - - - + W1:w1:e -- W1:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#8000FF:#000000" straight=straight] + W2 [label=< +
- - -
W1
-
- - - - - -
I2C4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - PK - X2:1:GND
- - - - -
-
X1:2:VCC - TQ - X2:2:VCC
- - - - -
-
X1:3:SCL - YE - X2:3:SCL
- - - - -
-
X1:4:SDA - VT - X2:4:SDA
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W2
+
+ + + + + + + +
I2C4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X2:1:GND PK X3:1:GND
+ + + + + + + + + + +
+
X2:2:VCC TQ X3:2:VCC
+ + + + + + + + + + +
+
X2:3:SCL YE X3:3:SCL
+ + + + + + + + + + +
+
X2:4:SDA VT X3:4:SDA
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] - edge [color="#000000:#ff66cc:#000000"] +> shape=box style="filled,dashed"] + edge [color="#000000:#FF66CC:#000000"] X2:p1r:e -- W2:w1:w W2:w1:e -- X3:p1l:w - edge [color="#000000:#00ffff:#000000"] + edge [color="#000000:#00FFFF:#000000"] X2:p2r:e -- W2:w2:w W2:w2:e -- X3:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X2:p3r:e -- W2:w3:w W2:w3:e -- X3:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X2:p4r:e -- W2:w4:w W2:w4:e -- X3:p4l:w - W2 [label=< - - - - -
- - -
W2
-
- - - - - -
I2C4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X2:1:GND - PK - X3:1:GND
- - - - -
-
X2:2:VCC - TQ - X3:2:VCC
- - - - -
-
X2:3:SCL - YE - X3:3:SCL
- - - - -
-
X2:4:SDA - VT - X3:4:SDA
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] + W2:w1:e -- W2:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#8000FF:#000000" straight=straight] } diff --git a/examples/ex05.html b/examples/ex05.html index 5be09bd3c..26958bda2 100644 --- a/examples/ex05.html +++ b/examples/ex05.html @@ -1,7 +1,7 @@ - + ex05 - +

ex05

Diagram

@@ -30,301 +30,378 @@

Diagram

- - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - -W1 - -I2C - -4x - -0.25 mm² - -0.2 m -  -X1:1:GND -     PK     -X2:1:GND - - - -X1:2:VCC -     TQ     -X2:2:VCC - - - -X1:3:SCL -     YE     -X2:3:SCL - - - -X1:4:SDA -     VT     -X2:4:SDA - - - -  + + + +W1 + +I2C + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +PK + +X2:1:GND + + + + X1:2:VCC + +TQ + +X2:2:VCC + + + + X1:3:SCL + +YE + +X2:3:SCL + + + + X1:4:SDA + +VT + +X2:4:SDA + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -1 - -2 - -VCC - -2 - -3 - -SCL - -3 - -4 - -SDA - -4 + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +1 + +2 + +VCC + +2 + +3 + +SCL + +3 + +4 + +SDA + +4 + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + W2 - - -W2 - -I2C - -4x - -0.25 mm² - -0.2 m -  -X2:1:GND -     PK     -X3:1:GND - - - -X2:2:VCC -     TQ     -X3:2:VCC - - - -X2:3:SCL -     YE     -X3:3:SCL - - - -X2:4:SDA -     VT     -X3:4:SDA - - - -  + + + +W2 + +I2C + +4x + +0.25 mm² + +0.2 m +  + X2:1:GND + +PK + +X3:1:GND + + + + X2:2:VCC + +TQ + +X3:2:VCC + + + + X2:3:SCL + +YE + +X3:3:SCL + + + + X2:4:SDA + +VT + +X3:4:SDA + + + +  - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - - -X3 - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +X3 + + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + @@ -340,45 +417,45 @@

Bill of Materials

- - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + +
IdDescription# Qty UnitDescription Designators
1Connector, Molex KK 254, female, 4 pins1 3 Connector, Molex KK 254, female, 4 pins X1, X2, X3
2Wire, I2C, 0.25 mm², PK0.422 mWire, I2C, 0.25 mm², PK W1, W2
3Wire, I2C, 0.25 mm², TQ0.432 mWire, I2C, 0.25 mm², TQ W1, W2
4Wire, I2C, 0.25 mm², VT0.442 mWire, I2C, 0.25 mm², VT W1, W2
5Wire, I2C, 0.25 mm², YE0.452 mWire, I2C, 0.25 mm², YE W1, W2
diff --git a/examples/ex05.png b/examples/ex05.png index 82db4c13a..21446f961 100644 Binary files a/examples/ex05.png and b/examples/ex05.png differ diff --git a/examples/ex05.svg b/examples/ex05.svg index 6d4e75f7e..1f6cd1397 100644 --- a/examples/ex05.svg +++ b/examples/ex05.svg @@ -1,301 +1,378 @@ - - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - -W1 - -I2C - -4x - -0.25 mm² - -0.2 m -  -X1:1:GND -     PK     -X2:1:GND - - - -X1:2:VCC -     TQ     -X2:2:VCC - - - -X1:3:SCL -     YE     -X2:3:SCL - - - -X1:4:SDA -     VT     -X2:4:SDA - - - -  + + + +W1 + +I2C + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +PK + +X2:1:GND + + + + X1:2:VCC + +TQ + +X2:2:VCC + + + + X1:3:SCL + +YE + +X2:3:SCL + + + + X1:4:SDA + +VT + +X2:4:SDA + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -1 - -2 - -VCC - -2 - -3 - -SCL - -3 - -4 - -SDA - -4 + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +1 + +2 + +VCC + +2 + +3 + +SCL + +3 + +4 + +SDA + +4 + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + W2 - - -W2 - -I2C - -4x - -0.25 mm² - -0.2 m -  -X2:1:GND -     PK     -X3:1:GND - - - -X2:2:VCC -     TQ     -X3:2:VCC - - - -X2:3:SCL -     YE     -X3:3:SCL - - - -X2:4:SDA -     VT     -X3:4:SDA - - - -  + + + +W2 + +I2C + +4x + +0.25 mm² + +0.2 m +  + X2:1:GND + +PK + +X3:1:GND + + + + X2:2:VCC + +TQ + +X3:2:VCC + + + + X2:3:SCL + +YE + +X3:3:SCL + + + + X2:4:SDA + +VT + +X3:4:SDA + + + +  - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - - -X3 - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +X3 + + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + diff --git a/examples/ex05.tsv b/examples/ex05.tsv new file mode 100644 index 000000000..72ef03d4d --- /dev/null +++ b/examples/ex05.tsv @@ -0,0 +1,6 @@ +# Qty Unit Description Designators +1 3 Connector, Molex KK 254, female, 4 pins X1, X2, X3 +2 2 m Wire, I2C, 0.25 mm², PK W1, W2 +3 2 m Wire, I2C, 0.25 mm², TQ W1, W2 +4 2 m Wire, I2C, 0.25 mm², VT W1, W2 +5 2 m Wire, I2C, 0.25 mm², YE W1, W2 diff --git a/examples/ex05_wv_gvpr.gvpr b/examples/ex05_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex05_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex06.gv b/examples/ex06.gv index 6c67e91d4..85b86186a 100644 --- a/examples/ex06.gv +++ b/examples/ex06.gv @@ -1,713 +1,1027 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
GND1
VCC2
SCL3
SDA4
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
GND1
VCC2
SCL3
SDA4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
1GND
2VCC
3SCL
4SDA
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2VCC
3SCL
4SDA
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X3 [label=< - - - - +
- - -
X3
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
GND1
VCC2
SCL3
SDA4
-
+ + + + + + + + +
+ + + + +
X3
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
GND1
VCC2
SCL3
SDA4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X4 [label=< - - - - +
- - -
X4
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
1GND
2VCC
3SCL
4SDA
-
+ + + + + + + + +
+ + + + +
X4
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2VCC
3SCL
4SDA
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X5 [label=< - - - - +
- - -
X5
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
GND1
VCC2
SCL3
SDA4
-
+ + + + + + + + +
+ + + + +
X5
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
GND1
VCC2
SCL3
SDA4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X6 [label=< - - - - +
- - -
X6
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
1GND
2VCC
3SCL
4SDA
-
+ + + + + + + + +
+ + + + +
X6
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2VCC
3SCL
4SDA
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ff66cc:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND PK X2:1:GND
+ + + + + + + + + + +
+
X1:2:VCC TQ X2:2:VCC
+ + + + + + + + + + +
+
X1:3:SCL YE X2:3:SCL
+ + + + + + + + + + +
+
X1:4:SDA VT X2:4:SDA
+ + + + + + + + + + +
+
 
+
+> shape=box style="filled,dashed"] + edge [color="#000000:#FF66CC:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w - edge [color="#000000:#00ffff:#000000"] + edge [color="#000000:#00FFFF:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X1:p3r:e -- W1:w3:w W1:w3:e -- X2:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w - W1 [label=< - - - - + W1:w1:e -- W1:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#8000FF:#000000" straight=straight] + W2 [label=< +
- - -
W1
-
- - - - -
4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - PK - X2:1:GND
- - - - -
-
X1:2:VCC - TQ - X2:2:VCC
- - - - -
-
X1:3:SCL - YE - X2:3:SCL
- - - - -
-
X1:4:SDA - VT - X2:4:SDA
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W2
+
+ + + + + + +
4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X3:1:GND PK X2:1:GND
+ + + + + + + + + + +
+
X3:2:VCC TQ X2:2:VCC
+ + + + + + + + + + +
+
X3:3:SCL YE X2:3:SCL
+ + + + + + + + + + +
+
X3:4:SDA VT X2:4:SDA
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] - edge [color="#000000:#ff66cc:#000000"] +> shape=box style="filled,dashed"] + edge [color="#000000:#FF66CC:#000000"] X3:p1r:e -- W2:w1:w W2:w1:e -- X2:p1l:w - edge [color="#000000:#00ffff:#000000"] + edge [color="#000000:#00FFFF:#000000"] X3:p2r:e -- W2:w2:w W2:w2:e -- X2:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X3:p3r:e -- W2:w3:w W2:w3:e -- X2:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X3:p4r:e -- W2:w4:w W2:w4:e -- X2:p4l:w - W2 [label=< - - - - + W2:w1:e -- W2:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#8000FF:#000000" straight=straight] + W3 [label=< +
- - -
W2
-
- - - - -
4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X3:1:GND - PK - X2:1:GND
- - - - -
-
X3:2:VCC - TQ - X2:2:VCC
- - - - -
-
X3:3:SCL - YE - X2:3:SCL
- - - - -
-
X3:4:SDA - VT - X2:4:SDA
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W3
+
+ + + + + + +
4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X3:1:GND PK X4:1:GND
+ + + + + + + + + + +
+
X3:2:VCC TQ X4:2:VCC
+ + + + + + + + + + +
+
X3:3:SCL YE X4:3:SCL
+ + + + + + + + + + +
+
X3:4:SDA VT X4:4:SDA
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] - edge [color="#000000:#ff66cc:#000000"] +> shape=box style="filled,dashed"] + edge [color="#000000:#FF66CC:#000000"] X3:p1r:e -- W3:w1:w W3:w1:e -- X4:p1l:w - edge [color="#000000:#00ffff:#000000"] + edge [color="#000000:#00FFFF:#000000"] X3:p2r:e -- W3:w2:w W3:w2:e -- X4:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X3:p3r:e -- W3:w3:w W3:w3:e -- X4:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X3:p4r:e -- W3:w4:w W3:w4:e -- X4:p4l:w - W3 [label=< - - - - + W3:w1:e -- W3:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W3:w2:e -- W3:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W3:w3:e -- W3:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W3:w4:e -- W3:w4:w [color="#000000:#8000FF:#000000" straight=straight] + W4 [label=< +
- - -
W3
-
- - - - -
4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X3:1:GND - PK - X4:1:GND
- - - - -
-
X3:2:VCC - TQ - X4:2:VCC
- - - - -
-
X3:3:SCL - YE - X4:3:SCL
- - - - -
-
X3:4:SDA - VT - X4:4:SDA
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W4
+
+ + + + + + +
4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X5:1:GND PK X4:1:GND
+ + + + + + + + + + +
+
X5:2:VCC TQ X4:2:VCC
+ + + + + + + + + + +
+
X5:3:SCL YE X4:3:SCL
+ + + + + + + + + + +
+
X5:4:SDA VT X4:4:SDA
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] - edge [color="#000000:#ff66cc:#000000"] +> shape=box style="filled,dashed"] + edge [color="#000000:#FF66CC:#000000"] X5:p1r:e -- W4:w1:w W4:w1:e -- X4:p1l:w - edge [color="#000000:#00ffff:#000000"] + edge [color="#000000:#00FFFF:#000000"] X5:p2r:e -- W4:w2:w W4:w2:e -- X4:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X5:p3r:e -- W4:w3:w W4:w3:e -- X4:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X5:p4r:e -- W4:w4:w W4:w4:e -- X4:p4l:w - W4 [label=< - - - - + W4:w1:e -- W4:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W4:w2:e -- W4:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W4:w3:e -- W4:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W4:w4:e -- W4:w4:w [color="#000000:#8000FF:#000000" straight=straight] + W5 [label=< +
- - -
W4
-
- - - - -
4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X5:1:GND - PK - X4:1:GND
- - - - -
-
X5:2:VCC - TQ - X4:2:VCC
- - - - -
-
X5:3:SCL - YE - X4:3:SCL
- - - - -
-
X5:4:SDA - VT - X4:4:SDA
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W5
+
+ + + + + + +
4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X5:1:GND PK X6:1:GND
+ + + + + + + + + + +
+
X5:2:VCC TQ X6:2:VCC
+ + + + + + + + + + +
+
X5:3:SCL YE X6:3:SCL
+ + + + + + + + + + +
+
X5:4:SDA VT X6:4:SDA
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] - edge [color="#000000:#ff66cc:#000000"] +> shape=box style="filled,dashed"] + edge [color="#000000:#FF66CC:#000000"] X5:p1r:e -- W5:w1:w W5:w1:e -- X6:p1l:w - edge [color="#000000:#00ffff:#000000"] + edge [color="#000000:#00FFFF:#000000"] X5:p2r:e -- W5:w2:w W5:w2:e -- X6:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X5:p3r:e -- W5:w3:w W5:w3:e -- X6:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X5:p4r:e -- W5:w4:w W5:w4:e -- X6:p4l:w - W5 [label=< - - - - -
- - -
W5
-
- - - - -
4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X5:1:GND - PK - X6:1:GND
- - - - -
-
X5:2:VCC - TQ - X6:2:VCC
- - - - -
-
X5:3:SCL - YE - X6:3:SCL
- - - - -
-
X5:4:SDA - VT - X6:4:SDA
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] + W5:w1:e -- W5:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W5:w2:e -- W5:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W5:w3:e -- W5:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W5:w4:e -- W5:w4:w [color="#000000:#8000FF:#000000" straight=straight] } diff --git a/examples/ex06.html b/examples/ex06.html index 79d118202..e4d5e1fe7 100644 --- a/examples/ex06.html +++ b/examples/ex06.html @@ -1,7 +1,7 @@ - + ex06 - +

ex06

Diagram

@@ -30,661 +30,852 @@

Diagram

- - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - -W1 - -4x - -0.25 mm² - -0.2 m -  -X1:1:GND -     PK     -X2:1:GND - - - -X1:2:VCC -     TQ     -X2:2:VCC - - - -X1:3:SCL -     YE     -X2:3:SCL - - - -X1:4:SDA -     VT     -X2:4:SDA - - - -  + + + +W1 + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +PK + +X2:1:GND + + + + X1:2:VCC + +TQ + +X2:2:VCC + + + + X1:3:SCL + +YE + +X2:3:SCL + + + + X1:4:SDA + +VT + +X2:4:SDA + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + X3 - - -X3 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X3 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W2 - - -W2 - -4x - -0.25 mm² - -0.2 m -  -X3:1:GND -     PK     -X2:1:GND - - - -X3:2:VCC -     TQ     -X2:2:VCC - - - -X3:3:SCL -     YE     -X2:3:SCL - - - -X3:4:SDA -     VT     -X2:4:SDA - - - -  + + + +W2 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +PK + +X2:1:GND + + + + X3:2:VCC + +TQ + +X2:2:VCC + + + + X3:3:SCL + +YE + +X2:3:SCL + + + + X3:4:SDA + +VT + +X2:4:SDA + + + +  - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + W3 - - -W3 - -4x - -0.25 mm² - -0.2 m -  -X3:1:GND -     PK     -X4:1:GND - - - -X3:2:VCC -     TQ     -X4:2:VCC - - - -X3:3:SCL -     YE     -X4:3:SCL - - - -X3:4:SDA -     VT     -X4:4:SDA - - - -  + + + +W3 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +PK + +X4:1:GND + + + + X3:2:VCC + +TQ + +X4:2:VCC + + + + X3:3:SCL + +YE + +X4:3:SCL + + + + X3:4:SDA + +VT + +X4:4:SDA + + + +  X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + X4 - - -X4 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X4 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + - + X5 - - -X5 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X5 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W4 - - -W4 - -4x - -0.25 mm² - -0.2 m -  -X5:1:GND -     PK     -X4:1:GND - - - -X5:2:VCC -     TQ     -X4:2:VCC - - - -X5:3:SCL -     YE     -X4:3:SCL - - - -X5:4:SDA -     VT     -X4:4:SDA - - - -  + + + +W4 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +PK + +X4:1:GND + + + + X5:2:VCC + +TQ + +X4:2:VCC + + + + X5:3:SCL + +YE + +X4:3:SCL + + + + X5:4:SDA + +VT + +X4:4:SDA + + + +  - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + W5 - - -W5 - -4x - -0.25 mm² - -0.2 m -  -X5:1:GND -     PK     -X6:1:GND - - - -X5:2:VCC -     TQ     -X6:2:VCC - - - -X5:3:SCL -     YE     -X6:3:SCL - - - -X5:4:SDA -     VT     -X6:4:SDA - - - -  + + + +W5 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +PK + +X6:1:GND + + + + X5:2:VCC + +TQ + +X6:2:VCC + + + + X5:3:SCL + +YE + +X6:3:SCL + + + + X5:4:SDA + +VT + +X6:4:SDA + + + +  - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - - - - -X6 - - -X6 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +X6 + + + +X6 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + @@ -700,45 +891,45 @@

Bill of Materials

- - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + +
IdDescription# Qty UnitDescription Designators
1Connector, Molex KK 254, female, 4 pins1 6 Connector, Molex KK 254, female, 4 pins X1, X2, X3, X4, X5, X6
2Wire, 0.25 mm², PK1.025 mWire, 0.25 mm², PK W1, W2, W3, W4, W5
3Wire, 0.25 mm², TQ1.035 mWire, 0.25 mm², TQ W1, W2, W3, W4, W5
4Wire, 0.25 mm², VT1.045 mWire, 0.25 mm², VT W1, W2, W3, W4, W5
5Wire, 0.25 mm², YE1.055 mWire, 0.25 mm², YE W1, W2, W3, W4, W5
diff --git a/examples/ex06.png b/examples/ex06.png index 7b4a61848..c0184b727 100644 Binary files a/examples/ex06.png and b/examples/ex06.png differ diff --git a/examples/ex06.svg b/examples/ex06.svg index fa1c37850..60ef043a1 100644 --- a/examples/ex06.svg +++ b/examples/ex06.svg @@ -1,661 +1,852 @@ - - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - -W1 - -4x - -0.25 mm² - -0.2 m -  -X1:1:GND -     PK     -X2:1:GND - - - -X1:2:VCC -     TQ     -X2:2:VCC - - - -X1:3:SCL -     YE     -X2:3:SCL - - - -X1:4:SDA -     VT     -X2:4:SDA - - - -  + + + +W1 + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +PK + +X2:1:GND + + + + X1:2:VCC + +TQ + +X2:2:VCC + + + + X1:3:SCL + +YE + +X2:3:SCL + + + + X1:4:SDA + +VT + +X2:4:SDA + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + X3 - - -X3 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X3 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W2 - - -W2 - -4x - -0.25 mm² - -0.2 m -  -X3:1:GND -     PK     -X2:1:GND - - - -X3:2:VCC -     TQ     -X2:2:VCC - - - -X3:3:SCL -     YE     -X2:3:SCL - - - -X3:4:SDA -     VT     -X2:4:SDA - - - -  + + + +W2 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +PK + +X2:1:GND + + + + X3:2:VCC + +TQ + +X2:2:VCC + + + + X3:3:SCL + +YE + +X2:3:SCL + + + + X3:4:SDA + +VT + +X2:4:SDA + + + +  - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + W3 - - -W3 - -4x - -0.25 mm² - -0.2 m -  -X3:1:GND -     PK     -X4:1:GND - - - -X3:2:VCC -     TQ     -X4:2:VCC - - - -X3:3:SCL -     YE     -X4:3:SCL - - - -X3:4:SDA -     VT     -X4:4:SDA - - - -  + + + +W3 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +PK + +X4:1:GND + + + + X3:2:VCC + +TQ + +X4:2:VCC + + + + X3:3:SCL + +YE + +X4:3:SCL + + + + X3:4:SDA + +VT + +X4:4:SDA + + + +  X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + X4 - - -X4 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X4 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + - + X5 - - -X5 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X5 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W4 - - -W4 - -4x - -0.25 mm² - -0.2 m -  -X5:1:GND -     PK     -X4:1:GND - - - -X5:2:VCC -     TQ     -X4:2:VCC - - - -X5:3:SCL -     YE     -X4:3:SCL - - - -X5:4:SDA -     VT     -X4:4:SDA - - - -  + + + +W4 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +PK + +X4:1:GND + + + + X5:2:VCC + +TQ + +X4:2:VCC + + + + X5:3:SCL + +YE + +X4:3:SCL + + + + X5:4:SDA + +VT + +X4:4:SDA + + + +  - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + W5 - - -W5 - -4x - -0.25 mm² - -0.2 m -  -X5:1:GND -     PK     -X6:1:GND - - - -X5:2:VCC -     TQ     -X6:2:VCC - - - -X5:3:SCL -     YE     -X6:3:SCL - - - -X5:4:SDA -     VT     -X6:4:SDA - - - -  + + + +W5 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +PK + +X6:1:GND + + + + X5:2:VCC + +TQ + +X6:2:VCC + + + + X5:3:SCL + +YE + +X6:3:SCL + + + + X5:4:SDA + +VT + +X6:4:SDA + + + +  - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - - - - -X6 - - -X6 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +X6 + + + +X6 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + diff --git a/examples/ex06.tsv b/examples/ex06.tsv new file mode 100644 index 000000000..62377db6b --- /dev/null +++ b/examples/ex06.tsv @@ -0,0 +1,6 @@ +# Qty Unit Description Designators +1 6 Connector, Molex KK 254, female, 4 pins X1, X2, X3, X4, X5, X6 +2 5 m Wire, 0.25 mm², PK W1, W2, W3, W4, W5 +3 5 m Wire, 0.25 mm², TQ W1, W2, W3, W4, W5 +4 5 m Wire, 0.25 mm², VT W1, W2, W3, W4, W5 +5 5 m Wire, 0.25 mm², YE W1, W2, W3, W4, W5 diff --git a/examples/ex06_wv_gvpr.gvpr b/examples/ex06_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex06_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex07.gv b/examples/ex07.gv index 836e9547a..c1999cca7 100644 --- a/examples/ex07.gv +++ b/examples/ex07.gv @@ -1,129 +1,193 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - - +
- - -
X1
-
- - - - -
TE 776164-1female35-pin
-
- - - - - - - -
5
6
-
- - -
Unconnected pins are not shown
-
+ + + + + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
TE 776164-1female35-pin
+
+ + + + [] + + + + + [] + + +
5
6
+
+ + + + +
Unconnected pins are not shown
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - - +
- - -
X2
-
- - - - -
D-Subfemale9-pin
-
- - - - - - - -
2
7
-
- - -
Unconnected pins are not shown
-
+ + + + + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
D-Subfemale9-pin
+
+ + + + + [] + + + + + [] + +
2
7
+
+ + + + +
Unconnected pins are not shown
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffff00:#000000"] +> shape=box style=filled] + C1 [label=< + + + + + + + + + + +
+ + + + +
C1
+
+ + + + + + +
2x20 AWG1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:5 1:YE X2:7
+ + + + + + + + + + +
+
X1:6 2:GN X2:2
+ + + + + + + + + + +
+
 
+
+> shape=box style=filled] + edge [color="#000000:#FFFF00:#000000"] X1:p5r:e -- C1:w1:w C1:w1:e -- X2:p7l:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] X1:p6r:e -- C1:w2:w C1:w2:e -- X2:p2l:w - C1 [label=< - - - - -
- - -
C1
-
- - - - -
2x20 AWG1 m
-
- - - - - - - - - - - - - - - - - - - -
 
X1:5 - 1:YE - X2:7
- - - - -
-
X1:6 - 2:GN - X2:2
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] + C1:w1:e -- C1:w1:w [color="#000000:#FFFF00:#000000" straight=straight] + C1:w2:e -- C1:w2:w [color="#000000:#00AA00:#000000" straight=straight] } diff --git a/examples/ex07.html b/examples/ex07.html index 975058a99..af09a6d12 100644 --- a/examples/ex07.html +++ b/examples/ex07.html @@ -1,7 +1,7 @@ - + ex07 - +

ex07

Diagram

@@ -30,105 +30,126 @@

Diagram

- - - - + + + X1 - - -X1 - -TE 776164-1 - -female - -35-pin - -5 - -6 - -Unconnected pins are not shown + + + +X1 + +TE 776164-1 + +female + +35-pin + +5 + +6 + +Unconnected pins are not shown - + C1 - - -C1 - -2x - -20 AWG - -1 m -  -X1:5 -     1:YE     -X2:7 - - - -X1:6 -     2:GN     -X2:2 - - - -  + + + +C1 + +2x + +20 AWG + +1 m +  + X1:5 + +1:YE + +X2:7 + + + + X1:6 + +2:GN + +X2:2 + + + +  X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + - + X2 - - -X2 - -D-Sub - -female - -9-pin - -2 - -7 - -Unconnected pins are not shown + + + +X2 + +D-Sub + +female + +9-pin + +2 + +7 + +Unconnected pins are not shown - + C1:e--X2:w - - - + + + - + C1:e--X2:w - - - + + + @@ -144,33 +165,33 @@

Bill of Materials

- - + + - - - - - - - - - + + - - + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, 2 x 20 AWG1mC1
2Connector, D-Sub, female, 9 pins1 1 Connector, D-Sub, female, 9 pins X2
3Connector, TE 776164-1, female, 35 pins2 1 Connector, TE 776164-1, female, 35 pins X1
31mCable, 2 x 20 AWGC1
diff --git a/examples/ex07.png b/examples/ex07.png index 16c485009..4a8eebe4e 100644 Binary files a/examples/ex07.png and b/examples/ex07.png differ diff --git a/examples/ex07.svg b/examples/ex07.svg index 2c92ead02..594abd2d6 100644 --- a/examples/ex07.svg +++ b/examples/ex07.svg @@ -1,105 +1,126 @@ - - - - + + + X1 - - -X1 - -TE 776164-1 - -female - -35-pin - -5 - -6 - -Unconnected pins are not shown + + + +X1 + +TE 776164-1 + +female + +35-pin + +5 + +6 + +Unconnected pins are not shown - + C1 - - -C1 - -2x - -20 AWG - -1 m -  -X1:5 -     1:YE     -X2:7 - - - -X1:6 -     2:GN     -X2:2 - - - -  + + + +C1 + +2x + +20 AWG + +1 m +  + X1:5 + +1:YE + +X2:7 + + + + X1:6 + +2:GN + +X2:2 + + + +  X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + - + X2 - - -X2 - -D-Sub - -female - -9-pin - -2 - -7 - -Unconnected pins are not shown + + + +X2 + +D-Sub + +female + +9-pin + +2 + +7 + +Unconnected pins are not shown - + C1:e--X2:w - - - + + + - + C1:e--X2:w - - - + + + diff --git a/examples/ex07.tsv b/examples/ex07.tsv new file mode 100644 index 000000000..86ffe9d7e --- /dev/null +++ b/examples/ex07.tsv @@ -0,0 +1,4 @@ +# Qty Unit Description Designators +1 1 Connector, D-Sub, female, 9 pins X2 +2 1 Connector, TE 776164-1, female, 35 pins X1 +3 1 m Cable, 2 x 20 AWG C1 diff --git a/examples/ex07_wv_gvpr.gvpr b/examples/ex07_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex07_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex08.gv b/examples/ex08.gv index 1460a02cf..20426060f 100644 --- a/examples/ex08.gv +++ b/examples/ex08.gv @@ -1,150 +1,235 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] Key [label=< - - - - - - +
- - -
Key
-
- - - -
Phone Connectormale 3.5
-
- - - - - - - - - - - - - -
DotT
DashR
GroundS
-
- - -
-
- - -
Tip, Ring, and Sleeve
-
+ + + + + + + + + + + + + + +
+ + + + +
Key
+
+ + + + + +
Phone Connectormale 3.5
+
+ + + + [] + + + + + [] + + + + + [] + + +
DotT
DashR
GroundS
+
+ + + + +
+
+ + + + +
Tip, Ring, and Sleeve
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + + + + +
3x24 AWG+ S0.2 mBK
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
Key:S:Ground 1:WH
+ + + + + + + + + + +
+
Key:R:Dash 2:BN
+ + + + + + + + + + +
+
Key:T:Dot 3:GN
+ + + + + + + + + + +
+
 
Key:S:Ground SN:Shield
+ + + + + + + + + + +
+
 
+
+ + + + +
+ + + + +
+
+
+ + + + +
Cross-section
+
+> shape=box style=filled] + edge [color="#000000:#FFFFFF:#000000"] Key:p3r:e -- W1:w1:w edge [color="#000000:#895956:#000000"] Key:p2r:e -- W1:w2:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] Key:p1r:e -- W1:w3:w - edge [color="#000000:#aaaaaa:#000000"] - Key:p3r:e -- W1:ws:w - W1 [label=< - - - - - - -
- - -
W1
-
- - - - - - - -
3x24 AWG+ S0.2 mBK
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
Key:S:Ground - 1:WH -
- - - - -
-
Key:R:Dash - 2:BN -
- - - - -
-
Key:T:Dot - 3:GN -
- - - - -
-
 
Key:S:GroundShield
 
-
- - -
- - -
-
-
- - -
Cross-section
-
-> fillcolor="#FFFFFF" shape=box style=filled] + edge [color="#000000:#AAAAAA:#000000"] + Key:p3r:e -- W1:w4:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#AAAAAA:#000000" straight=straight] } diff --git a/examples/ex08.html b/examples/ex08.html index cd62b4af5..1bf14996b 100644 --- a/examples/ex08.html +++ b/examples/ex08.html @@ -1,7 +1,7 @@ - + ex08 - +

ex08

Diagram

@@ -30,113 +30,155 @@

Diagram

- - - - + + + Key - - -Key - -Phone Connector - -male 3.5 - -Dot - -T - -Dash - -R - -Ground - -S - - - -Tip, Ring, and Sleeve + + + +Key + +Phone Connector + +male 3.5 + +Dot + +T + +Dash + +R + +Ground + +S + + + +Tip, Ring, and Sleeve W1 - - -W1 - -3x - -24 AWG - -+ S - -0.2 m - -BK - - -  -Key:S:Ground -     1:WH     - - - -Key:R:Dash -     2:BN     - - - -Key:T:Dot -     3:GN     - - - -  -Key:S:Ground -Shield - - - -  - - - -Cross-section + + + +W1 + +3x + +24 AWG + ++ S + +0.2 m + +BK + + +  + Key:S:Ground + +1:WH + + + + + + Key:R:Dash + +2:BN + + + + + + Key:T:Dot + +3:GN + + + + + +  + Key:S:Ground + +SN:Shield + + + + + +  + + + +Cross-section Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + @@ -152,26 +194,26 @@

Bill of Materials

- - + + - - - - - - - - - + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, 3 x 24 AWG shielded, BK0.2mW1
2Connector, Phone Connector, male 3.51 1 Connector, Phone Connector, male 3.5 Key
21mCable, 3 x 24 AWG shielded, BKW1
diff --git a/examples/ex08.png b/examples/ex08.png index 09cac1350..73181110f 100644 Binary files a/examples/ex08.png and b/examples/ex08.png differ diff --git a/examples/ex08.svg b/examples/ex08.svg index 78ab558e6..9e448f8ba 100644 --- a/examples/ex08.svg +++ b/examples/ex08.svg @@ -1,113 +1,155 @@ - - - - + + + Key - - -Key - -Phone Connector - -male 3.5 - -Dot - -T - -Dash - -R - -Ground - -S - - - -Tip, Ring, and Sleeve + + + +Key + +Phone Connector + +male 3.5 + +Dot + +T + +Dash + +R + +Ground + +S + + + +Tip, Ring, and Sleeve W1 - - -W1 - -3x - -24 AWG - -+ S - -0.2 m - -BK - - -  -Key:S:Ground -     1:WH     - - - -Key:R:Dash -     2:BN     - - - -Key:T:Dot -     3:GN     - - - -  -Key:S:Ground -Shield - - - -  - - - -Cross-section + + + +W1 + +3x + +24 AWG + ++ S + +0.2 m + +BK + + +  + Key:S:Ground + +1:WH + + + + + + Key:R:Dash + +2:BN + + + + + + Key:T:Dot + +3:GN + + + + + +  + Key:S:Ground + +SN:Shield + + + + + +  + + + +Cross-section Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + diff --git a/examples/ex08.tsv b/examples/ex08.tsv new file mode 100644 index 000000000..b03b2ea04 --- /dev/null +++ b/examples/ex08.tsv @@ -0,0 +1,3 @@ +# Qty Unit Description Designators +1 1 Connector, Phone Connector, male 3.5 Key +2 1 m Cable, 3 x 24 AWG shielded, BK W1 diff --git a/examples/ex08_wv_gvpr.gvpr b/examples/ex08_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex08_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex09.gv b/examples/ex09.gv index 2a01a51ad..f5decb9b4 100644 --- a/examples/ex09.gv +++ b/examples/ex09.gv @@ -1,527 +1,815 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
D-Submale25-pin
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SENSE_P_11
SENSE_N_114
SENSE_P_23
SENSE_N_216
SENSE_P_35
SENSE_N_318
SENSE_P_47
SENSE_N_420
SENSE_P_59
SENSE_N_522
SENSE_P_611
SENSE_N_624
GND13
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
D-Submale25-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
SENSE_P_11
SENSE_N_114
SENSE_P_23
SENSE_N_216
SENSE_P_35
SENSE_N_318
SENSE_P_47
SENSE_N_420
SENSE_P_59
SENSE_N_522
SENSE_P_611
SENSE_N_624
GND13
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - -
F48female48-pin
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
z2
b2
d2
z4
b4
d4
z6
b6
d6
z8
b8
d8
z10
b10
d10
z12
b12
d12
z14
b14
d14
z16
b16
d16
z18
b18
d18
z20
b20
d20
z22
b22
d22
z24
b24
d24
z26
b26
d26
z28
b28
d28
z30
b30
d30
z32
b32
d32
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
F48female48-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
z2
b2
d2
z4
b4
d4
z6
b6
d6
z8
b8
d8
z10
b10
d10
z12
b12
d12
z14
b14
d14
z16
b16
d16
z18
b18
d18
z20
b20
d20
z22
b22
d22
z24
b24
d24
z26
b26
d26
z28
b28
d28
z30
b30
d30
z32
b32
d32
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + + +
12x0.25 mm²+ S0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:14:SENSE_N_1 1:WH X2:z2
+ + + + + + + + + + + + + + + + +
+
X1:1:SENSE_P_1 2:BN X2:d4
+ + + + + + + + + + + + + + + + +
+
X1:16:SENSE_N_2 3:GN X2:z8
+ + + + + + + + + + + + + + + + +
+
X1:3:SENSE_P_2 4:YE X2:d10
+ + + + + + + + + + + + + + + + +
+
X1:18:SENSE_N_3 5:GY X2:z14
+ + + + + + + + + + + + + + + + +
+
X1:5:SENSE_P_3 6:PK X2:d16
+ + + + + + + + + + + + + + + + +
+
X1:20:SENSE_N_4 7:BU X2:z18
+ + + + + + + + + + + + + + + + +
+
X1:7:SENSE_P_4 8:RD X2:d20
+ + + + + + + + + + + + + + + + +
+
X1:22:SENSE_N_5 9:BK X2:z24
+ + + + + + + + + + + + + + + + +
+
X1:9:SENSE_P_5 10:VT X2:d26
+ + + + + + + + + + + + + + + + +
+
X1:24:SENSE_N_6 11:GYPK X2:z30
+ + + + + + + + + + + + + + + + +
+
X1:11:SENSE_P_6 12:RDBU X2:d32
+ + + + + + + + + + + + + + + + +
+
 
X1:13:GND Shield
+ + + + +
+
 
+
+> shape=box style=filled] edge [color="#000000:#895956:#895956:#895956:#000000"] X1:p1r:e -- W1:w2:w W1:w2:e -- X2:p6l:w - edge [color="#000000:#ffffff:#ffffff:#ffffff:#000000"] + edge [color="#000000:#FFFFFF:#FFFFFF:#FFFFFF:#000000"] X1:p2r:e -- W1:w1:w W1:w1:e -- X2:p1l:w - edge [color="#000000:#ffff00:#ffff00:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#FFFF00:#FFFF00:#000000"] X1:p3r:e -- W1:w4:w W1:w4:e -- X2:p15l:w - edge [color="#000000:#00ff00:#00ff00:#00ff00:#000000"] + edge [color="#000000:#00AA00:#00AA00:#00AA00:#000000"] X1:p4r:e -- W1:w3:w W1:w3:e -- X2:p10l:w - edge [color="#000000:#ff66cc:#ff66cc:#ff66cc:#000000"] + edge [color="#000000:#FF66CC:#FF66CC:#FF66CC:#000000"] X1:p5r:e -- W1:w6:w W1:w6:e -- X2:p24l:w edge [color="#000000:#999999:#999999:#999999:#000000"] X1:p6r:e -- W1:w5:w W1:w5:e -- X2:p19l:w - edge [color="#000000:#ff0000:#ff0000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#FF0000:#FF0000:#000000"] X1:p7r:e -- W1:w8:w W1:w8:e -- X2:p30l:w - edge [color="#000000:#0066ff:#0066ff:#0066ff:#000000"] + edge [color="#000000:#0066FF:#0066FF:#0066FF:#000000"] X1:p8r:e -- W1:w7:w W1:w7:e -- X2:p25l:w - edge [color="#000000:#8000ff:#8000ff:#8000ff:#000000"] + edge [color="#000000:#8000FF:#8000FF:#8000FF:#000000"] X1:p9r:e -- W1:w10:w W1:w10:e -- X2:p39l:w edge [color="#000000:#000000:#000000:#000000:#000000"] X1:p10r:e -- W1:w9:w W1:w9:e -- X2:p34l:w - edge [color="#000000:#ff0000:#0066ff:#ff0000:#000000"] + edge [color="#000000:#FF0000:#0066FF:#FF0000:#000000"] X1:p11r:e -- W1:w12:w W1:w12:e -- X2:p48l:w - edge [color="#000000:#999999:#ff66cc:#999999:#000000"] + edge [color="#000000:#999999:#FF66CC:#999999:#000000"] X1:p12r:e -- W1:w11:w W1:w11:e -- X2:p43l:w edge [color="#000000"] - X1:p13r:e -- W1:ws:w - W1 [label=< - - - - -
- - -
W1
-
- - - - - -
12x0.25 mm²+ S0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:14:SENSE_N_1 - 1:WH - X2:z2
- - - - - - -
-
X1:1:SENSE_P_1 - 2:BN - X2:d4
- - - - - - -
-
X1:16:SENSE_N_2 - 3:GN - X2:z8
- - - - - - -
-
X1:3:SENSE_P_2 - 4:YE - X2:d10
- - - - - - -
-
X1:18:SENSE_N_3 - 5:GY - X2:z14
- - - - - - -
-
X1:5:SENSE_P_3 - 6:PK - X2:d16
- - - - - - -
-
X1:20:SENSE_N_4 - 7:BU - X2:z18
- - - - - - -
-
X1:7:SENSE_P_4 - 8:RD - X2:d20
- - - - - - -
-
X1:22:SENSE_N_5 - 9:BK - X2:z24
- - - - - - -
-
X1:9:SENSE_P_5 - 10:VT - X2:d26
- - - - - - -
-
X1:24:SENSE_N_6 - 11:GYPK - X2:z30
- - - - - - -
-
X1:11:SENSE_P_6 - 12:RDBU - X2:d32
- - - - - - -
-
 
X1:13:GNDShield
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] + X1:p13r:e -- W1:w13:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#FFFFFF:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#895956:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#00AA00:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#FFFF00:#FFFF00:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000:#999999:#999999:#999999:#000000" straight=straight] + W1:w6:e -- W1:w6:w [color="#000000:#FF66CC:#FF66CC:#FF66CC:#000000" straight=straight] + W1:w7:e -- W1:w7:w [color="#000000:#0066FF:#0066FF:#0066FF:#000000" straight=straight] + W1:w8:e -- W1:w8:w [color="#000000:#FF0000:#FF0000:#FF0000:#000000" straight=straight] + W1:w9:e -- W1:w9:w [color="#000000:#000000:#000000:#000000:#000000" straight=straight] + W1:w10:e -- W1:w10:w [color="#000000:#8000FF:#8000FF:#8000FF:#000000" straight=straight] + W1:w11:e -- W1:w11:w [color="#000000:#999999:#FF66CC:#999999:#000000" straight=straight] + W1:w12:e -- W1:w12:w [color="#000000:#FF0000:#0066FF:#FF0000:#000000" straight=straight] + W1:w13:e -- W1:w13:w [color="#000000" straight=straight] } diff --git a/examples/ex09.html b/examples/ex09.html index 8c6a6fe06..d7a02bfac 100644 --- a/examples/ex09.html +++ b/examples/ex09.html @@ -1,7 +1,7 @@ - + ex09 - +

ex09

Diagram

@@ -30,524 +30,667 @@

Diagram

- - - - + + + X1 - - -X1 - -D-Sub - -male - -25-pin - -SENSE_P_1 - -1 - -SENSE_N_1 - -14 - -SENSE_P_2 - -3 - -SENSE_N_2 - -16 - -SENSE_P_3 - -5 - -SENSE_N_3 - -18 - -SENSE_P_4 - -7 - -SENSE_N_4 - -20 - -SENSE_P_5 - -9 - -SENSE_N_5 - -22 - -SENSE_P_6 - -11 - -SENSE_N_6 - -24 - -GND - -13 + + + +X1 + +D-Sub + +male + +25-pin + +SENSE_P_1 + +1 + +SENSE_N_1 + +14 + +SENSE_P_2 + +3 + +SENSE_N_2 + +16 + +SENSE_P_3 + +5 + +SENSE_N_3 + +18 + +SENSE_P_4 + +7 + +SENSE_N_4 + +20 + +SENSE_P_5 + +9 + +SENSE_N_5 + +22 + +SENSE_P_6 + +11 + +SENSE_N_6 + +24 + +GND + +13 - + W1 - - -W1 - -12x - -0.25 mm² - -+ S - -0.2 m -  -X1:14:SENSE_N_1 -     1:WH     -X2:z2 - - - - - -X1:1:SENSE_P_1 -     2:BN     -X2:d4 - - - - - -X1:16:SENSE_N_2 -     3:GN     -X2:z8 - - - - - -X1:3:SENSE_P_2 -     4:YE     -X2:d10 - - - - - -X1:18:SENSE_N_3 -     5:GY     -X2:z14 - - - - - -X1:5:SENSE_P_3 -     6:PK     -X2:d16 - - - - - -X1:20:SENSE_N_4 -     7:BU     -X2:z18 - - - - - -X1:7:SENSE_P_4 -     8:RD     -X2:d20 - - - - - -X1:22:SENSE_N_5 -     9:BK     -X2:z24 - - - - - -X1:9:SENSE_P_5 -     10:VT     -X2:d26 - - - - - -X1:24:SENSE_N_6 -     11:GYPK     -X2:z30 - - - - - -X1:11:SENSE_P_6 -     12:RDBU     -X2:d32 - - - - - -  -X1:13:GND -Shield - -  + + + +W1 + +12x + +0.25 mm² + ++ S + +0.2 m +  + X1:14:SENSE_N_1 + +1:WH + +X2:z2 + + + + + + X1:1:SENSE_P_1 + +2:BN + +X2:d4 + + + + + + X1:16:SENSE_N_2 + +3:GN + +X2:z8 + + + + + + X1:3:SENSE_P_2 + +4:YE + +X2:d10 + + + + + + X1:18:SENSE_N_3 + +5:GY + +X2:z14 + + + + + + X1:5:SENSE_P_3 + +6:PK + +X2:d16 + + + + + + X1:20:SENSE_N_4 + +7:BU + +X2:z18 + + + + + + X1:7:SENSE_P_4 + +8:RD + +X2:d20 + + + + + + X1:22:SENSE_N_5 + +9:BK + +X2:z24 + + + + + + X1:9:SENSE_P_5 + +10:VT + +X2:d26 + + + + + + X1:24:SENSE_N_6 + +11:GYPK + +X2:z30 + + + + + + X1:11:SENSE_P_6 + +12:RDBU + +X2:d32 + + + + + +  + X1:13:GND + +Shield + + + +  X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + - + X2 - - -X2 - -F48 - -female - -48-pin - -z2 - -b2 - -d2 - -z4 - -b4 - -d4 - -z6 - -b6 - -d6 - -z8 - -b8 - -d8 - -z10 - -b10 - -d10 - -z12 - -b12 - -d12 - -z14 - -b14 - -d14 - -z16 - -b16 - -d16 - -z18 - -b18 - -d18 - -z20 - -b20 - -d20 - -z22 - -b22 - -d22 - -z24 - -b24 - -d24 - -z26 - -b26 - -d26 - -z28 - -b28 - -d28 - -z30 - -b30 - -d30 - -z32 - -b32 - -d32 + + + +X2 + +F48 + +female + +48-pin + +z2 + +b2 + +d2 + +z4 + +b4 + +d4 + +z6 + +b6 + +d6 + +z8 + +b8 + +d8 + +z10 + +b10 + +d10 + +z12 + +b12 + +d12 + +z14 + +b14 + +d14 + +z16 + +b16 + +d16 + +z18 + +b18 + +d18 + +z20 + +b20 + +d20 + +z22 + +b22 + +d22 + +z24 + +b24 + +d24 + +z26 + +b26 + +d26 + +z28 + +b28 + +d28 + +z30 + +b30 + +d30 + +z32 + +b32 + +d32 - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + @@ -563,33 +706,33 @@

Bill of Materials

- - + + - - - - - - - - - + + - - + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, 12 x 0.25 mm² shielded0.2mW1
2Connector, D-Sub, male, 25 pins1 1 Connector, D-Sub, male, 25 pins X1
3Connector, F48, female, 48 pins2 1 Connector, F48, female, 48 pins X2
31mCable, 12 x 0.25 mm² shieldedW1
diff --git a/examples/ex09.png b/examples/ex09.png index d9bfc575e..0ba0c37dd 100644 Binary files a/examples/ex09.png and b/examples/ex09.png differ diff --git a/examples/ex09.svg b/examples/ex09.svg index e5e5c7cca..35fc6eb3a 100644 --- a/examples/ex09.svg +++ b/examples/ex09.svg @@ -1,524 +1,667 @@ - - - - + + + X1 - - -X1 - -D-Sub - -male - -25-pin - -SENSE_P_1 - -1 - -SENSE_N_1 - -14 - -SENSE_P_2 - -3 - -SENSE_N_2 - -16 - -SENSE_P_3 - -5 - -SENSE_N_3 - -18 - -SENSE_P_4 - -7 - -SENSE_N_4 - -20 - -SENSE_P_5 - -9 - -SENSE_N_5 - -22 - -SENSE_P_6 - -11 - -SENSE_N_6 - -24 - -GND - -13 + + + +X1 + +D-Sub + +male + +25-pin + +SENSE_P_1 + +1 + +SENSE_N_1 + +14 + +SENSE_P_2 + +3 + +SENSE_N_2 + +16 + +SENSE_P_3 + +5 + +SENSE_N_3 + +18 + +SENSE_P_4 + +7 + +SENSE_N_4 + +20 + +SENSE_P_5 + +9 + +SENSE_N_5 + +22 + +SENSE_P_6 + +11 + +SENSE_N_6 + +24 + +GND + +13 - + W1 - - -W1 - -12x - -0.25 mm² - -+ S - -0.2 m -  -X1:14:SENSE_N_1 -     1:WH     -X2:z2 - - - - - -X1:1:SENSE_P_1 -     2:BN     -X2:d4 - - - - - -X1:16:SENSE_N_2 -     3:GN     -X2:z8 - - - - - -X1:3:SENSE_P_2 -     4:YE     -X2:d10 - - - - - -X1:18:SENSE_N_3 -     5:GY     -X2:z14 - - - - - -X1:5:SENSE_P_3 -     6:PK     -X2:d16 - - - - - -X1:20:SENSE_N_4 -     7:BU     -X2:z18 - - - - - -X1:7:SENSE_P_4 -     8:RD     -X2:d20 - - - - - -X1:22:SENSE_N_5 -     9:BK     -X2:z24 - - - - - -X1:9:SENSE_P_5 -     10:VT     -X2:d26 - - - - - -X1:24:SENSE_N_6 -     11:GYPK     -X2:z30 - - - - - -X1:11:SENSE_P_6 -     12:RDBU     -X2:d32 - - - - - -  -X1:13:GND -Shield - -  + + + +W1 + +12x + +0.25 mm² + ++ S + +0.2 m +  + X1:14:SENSE_N_1 + +1:WH + +X2:z2 + + + + + + X1:1:SENSE_P_1 + +2:BN + +X2:d4 + + + + + + X1:16:SENSE_N_2 + +3:GN + +X2:z8 + + + + + + X1:3:SENSE_P_2 + +4:YE + +X2:d10 + + + + + + X1:18:SENSE_N_3 + +5:GY + +X2:z14 + + + + + + X1:5:SENSE_P_3 + +6:PK + +X2:d16 + + + + + + X1:20:SENSE_N_4 + +7:BU + +X2:z18 + + + + + + X1:7:SENSE_P_4 + +8:RD + +X2:d20 + + + + + + X1:22:SENSE_N_5 + +9:BK + +X2:z24 + + + + + + X1:9:SENSE_P_5 + +10:VT + +X2:d26 + + + + + + X1:24:SENSE_N_6 + +11:GYPK + +X2:z30 + + + + + + X1:11:SENSE_P_6 + +12:RDBU + +X2:d32 + + + + + +  + X1:13:GND + +Shield + + + +  X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + - + X2 - - -X2 - -F48 - -female - -48-pin - -z2 - -b2 - -d2 - -z4 - -b4 - -d4 - -z6 - -b6 - -d6 - -z8 - -b8 - -d8 - -z10 - -b10 - -d10 - -z12 - -b12 - -d12 - -z14 - -b14 - -d14 - -z16 - -b16 - -d16 - -z18 - -b18 - -d18 - -z20 - -b20 - -d20 - -z22 - -b22 - -d22 - -z24 - -b24 - -d24 - -z26 - -b26 - -d26 - -z28 - -b28 - -d28 - -z30 - -b30 - -d30 - -z32 - -b32 - -d32 + + + +X2 + +F48 + +female + +48-pin + +z2 + +b2 + +d2 + +z4 + +b4 + +d4 + +z6 + +b6 + +d6 + +z8 + +b8 + +d8 + +z10 + +b10 + +d10 + +z12 + +b12 + +d12 + +z14 + +b14 + +d14 + +z16 + +b16 + +d16 + +z18 + +b18 + +d18 + +z20 + +b20 + +d20 + +z22 + +b22 + +d22 + +z24 + +b24 + +d24 + +z26 + +b26 + +d26 + +z28 + +b28 + +d28 + +z30 + +b30 + +d30 + +z32 + +b32 + +d32 - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + diff --git a/examples/ex09.tsv b/examples/ex09.tsv new file mode 100644 index 000000000..74a0586c5 --- /dev/null +++ b/examples/ex09.tsv @@ -0,0 +1,4 @@ +# Qty Unit Description Designators +1 1 Connector, D-Sub, male, 25 pins X1 +2 1 Connector, F48, female, 48 pins X2 +3 1 m Cable, 12 x 0.25 mm² shielded W1 diff --git a/examples/ex09_wv_gvpr.gvpr b/examples/ex09_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex09_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex10.gv b/examples/ex10.gv index 7fa7bf29e..f2cd7c0ba 100644 --- a/examples/ex10.gv +++ b/examples/ex10.gv @@ -1,302 +1,440 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
Stewart Connector SS-37000-002male8-pin
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DA+1
DA-2
DB+3
DC+4
DC-5
DB-6
DD+7
DD-8
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Stewart Connector SS-37000-002male8-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
DA+1
DA-2
DB+3
DC+4
DC-5
DB-6
DD+7
DD-8
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - -
Stewart Connector SS-37000-002male8-pin
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1DB+
2DB-
3DA+
4DD+
5DD-
6DA-
7DC+
8DC-
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Stewart Connector SS-37000-002male8-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1DB+
2DB-
3DA+
4DD+
5DD-
6DA-
7DC+
8DC-
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#00ff00:#ffffff:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + + +
CAT5e8x24 AWG1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:DA+ 1:WHGN X2:3:DA+
+ + + + + + + + + + + + + + + + +
+
X1:2:DA- 2:GN X2:6:DA-
+ + + + + + + + + + + + + + + + +
+
X1:3:DB+ 3:WHOG X2:1:DB+
+ + + + + + + + + + + + + + + + +
+
X1:4:DC+ 4:BU X2:7:DC+
+ + + + + + + + + + + + + + + + +
+
X1:5:DC- 5:WHBU X2:8:DC-
+ + + + + + + + + + + + + + + + +
+
X1:6:DB- 6:OG X2:2:DB-
+ + + + + + + + + + + + + + + + +
+
X1:7:DD+ 7:WHBN X2:4:DD+
+ + + + + + + + + + + + + + + + +
+
X1:8:DD- 8:BN X2:5:DD-
+ + + + + + + + + + + + + + + + +
+
 
+
+> shape=box style=filled] + edge [color="#000000:#FFFFFF:#00AA00:#FFFFFF:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p3l:w - edge [color="#000000:#00ff00:#00ff00:#00ff00:#000000"] + edge [color="#000000:#00AA00:#00AA00:#00AA00:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p6l:w - edge [color="#000000:#ffffff:#ff8000:#ffffff:#000000"] + edge [color="#000000:#FFFFFF:#FF8000:#FFFFFF:#000000"] X1:p3r:e -- W1:w3:w W1:w3:e -- X2:p1l:w - edge [color="#000000:#0066ff:#0066ff:#0066ff:#000000"] + edge [color="#000000:#0066FF:#0066FF:#0066FF:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p7l:w - edge [color="#000000:#ffffff:#0066ff:#ffffff:#000000"] + edge [color="#000000:#FFFFFF:#0066FF:#FFFFFF:#000000"] X1:p5r:e -- W1:w5:w W1:w5:e -- X2:p8l:w - edge [color="#000000:#ff8000:#ff8000:#ff8000:#000000"] + edge [color="#000000:#FF8000:#FF8000:#FF8000:#000000"] X1:p6r:e -- W1:w6:w W1:w6:e -- X2:p2l:w - edge [color="#000000:#ffffff:#895956:#ffffff:#000000"] + edge [color="#000000:#FFFFFF:#895956:#FFFFFF:#000000"] X1:p7r:e -- W1:w7:w W1:w7:e -- X2:p4l:w edge [color="#000000:#895956:#895956:#895956:#000000"] X1:p8r:e -- W1:w8:w W1:w8:e -- X2:p5l:w - W1 [label=< - - - - -
- - -
W1
-
- - - - - -
CAT5e8x24 AWG1 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1:DA+ - 1:WHGN - X2:3:DA+
- - - - - - -
-
X1:2:DA- - 2:GN - X2:6:DA-
- - - - - - -
-
X1:3:DB+ - 3:WHOG - X2:1:DB+
- - - - - - -
-
X1:4:DC+ - 4:BU - X2:7:DC+
- - - - - - -
-
X1:5:DC- - 5:WHBU - X2:8:DC-
- - - - - - -
-
X1:6:DB- - 6:OG - X2:2:DB-
- - - - - - -
-
X1:7:DD+ - 7:WHBN - X2:4:DD+
- - - - - - -
-
X1:8:DD- - 8:BN - X2:5:DD-
- - - - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#00AA00:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#00AA00:#00AA00:#00AA00:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FFFFFF:#FF8000:#FFFFFF:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#0066FF:#0066FF:#0066FF:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000:#FFFFFF:#0066FF:#FFFFFF:#000000" straight=straight] + W1:w6:e -- W1:w6:w [color="#000000:#FF8000:#FF8000:#FF8000:#000000" straight=straight] + W1:w7:e -- W1:w7:w [color="#000000:#FFFFFF:#895956:#FFFFFF:#000000" straight=straight] + W1:w8:e -- W1:w8:w [color="#000000:#895956:#895956:#895956:#000000" straight=straight] } diff --git a/examples/ex10.html b/examples/ex10.html index 9fdba155e..b70f9b62c 100644 --- a/examples/ex10.html +++ b/examples/ex10.html @@ -1,7 +1,7 @@ - + ex10 - +

ex10

Diagram

@@ -30,327 +30,418 @@

Diagram

- - - - + + + X1 - - -X1 - -Stewart Connector SS-37000-002 - -male - -8-pin - -DA+ - -1 - -DA- - -2 - -DB+ - -3 - -DC+ - -4 - -DC- - -5 - -DB- - -6 - -DD+ - -7 - -DD- - -8 + + + +X1 + +Stewart Connector SS-37000-002 + +male + +8-pin + +DA+ + +1 + +DA- + +2 + +DB+ + +3 + +DC+ + +4 + +DC- + +5 + +DB- + +6 + +DD+ + +7 + +DD- + +8 - + W1 - - -W1 - -CAT5e - -8x - -24 AWG - -1 m -  -X1:1:DA+ -     1:WHGN     -X2:3:DA+ - - - - - -X1:2:DA- -     2:GN     -X2:6:DA- - - - - - -X1:3:DB+ -     3:WHOG     -X2:1:DB+ - - - - - -X1:4:DC+ -     4:BU     -X2:7:DC+ - - - - - -X1:5:DC- -     5:WHBU     -X2:8:DC- - - - - - -X1:6:DB- -     6:OG     -X2:2:DB- - - - - - -X1:7:DD+ -     7:WHBN     -X2:4:DD+ - - - - - -X1:8:DD- -     8:BN     -X2:5:DD- - - - - - -  + + + +W1 + +CAT5e + +8x + +24 AWG + +1 m +  + X1:1:DA+ + +1:WHGN + +X2:3:DA+ + + + + + + X1:2:DA- + +2:GN + +X2:6:DA- + + + + + + X1:3:DB+ + +3:WHOG + +X2:1:DB+ + + + + + + X1:4:DC+ + +4:BU + +X2:7:DC+ + + + + + + X1:5:DC- + +5:WHBU + +X2:8:DC- + + + + + + X1:6:DB- + +6:OG + +X2:2:DB- + + + + + + X1:7:DD+ + +7:WHBN + +X2:4:DD+ + + + + + + X1:8:DD- + +8:BN + +X2:5:DD- + + + + + +  X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + - + X2 - - -X2 - -Stewart Connector SS-37000-002 - -male - -8-pin - -1 - -DB+ - -2 - -DB- - -3 - -DA+ - -4 - -DD+ - -5 - -DD- - -6 - -DA- - -7 - -DC+ - -8 - -DC- + + + +X2 + +Stewart Connector SS-37000-002 + +male + +8-pin + +1 + +DB+ + +2 + +DB- + +3 + +DA+ + +4 + +DD+ + +5 + +DD- + +6 + +DA- + +7 + +DC+ + +8 + +DC- - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + @@ -366,26 +457,26 @@

Bill of Materials

- - + + - - - - - - - - - + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, CAT5e, 8 x 24 AWG1mW1
2Connector, Stewart Connector SS-37000-002, male, 8 pins1 2 Connector, Stewart Connector SS-37000-002, male, 8 pins X1, X2
21mCable, CAT5e, 8 x 24 AWGW1
diff --git a/examples/ex10.png b/examples/ex10.png index dfd45772e..c5d4cb3e2 100644 Binary files a/examples/ex10.png and b/examples/ex10.png differ diff --git a/examples/ex10.svg b/examples/ex10.svg index abc7168f6..903c871e0 100644 --- a/examples/ex10.svg +++ b/examples/ex10.svg @@ -1,327 +1,418 @@ - - - - + + + X1 - - -X1 - -Stewart Connector SS-37000-002 - -male - -8-pin - -DA+ - -1 - -DA- - -2 - -DB+ - -3 - -DC+ - -4 - -DC- - -5 - -DB- - -6 - -DD+ - -7 - -DD- - -8 + + + +X1 + +Stewart Connector SS-37000-002 + +male + +8-pin + +DA+ + +1 + +DA- + +2 + +DB+ + +3 + +DC+ + +4 + +DC- + +5 + +DB- + +6 + +DD+ + +7 + +DD- + +8 - + W1 - - -W1 - -CAT5e - -8x - -24 AWG - -1 m -  -X1:1:DA+ -     1:WHGN     -X2:3:DA+ - - - - - -X1:2:DA- -     2:GN     -X2:6:DA- - - - - - -X1:3:DB+ -     3:WHOG     -X2:1:DB+ - - - - - -X1:4:DC+ -     4:BU     -X2:7:DC+ - - - - - -X1:5:DC- -     5:WHBU     -X2:8:DC- - - - - - -X1:6:DB- -     6:OG     -X2:2:DB- - - - - - -X1:7:DD+ -     7:WHBN     -X2:4:DD+ - - - - - -X1:8:DD- -     8:BN     -X2:5:DD- - - - - - -  + + + +W1 + +CAT5e + +8x + +24 AWG + +1 m +  + X1:1:DA+ + +1:WHGN + +X2:3:DA+ + + + + + + X1:2:DA- + +2:GN + +X2:6:DA- + + + + + + X1:3:DB+ + +3:WHOG + +X2:1:DB+ + + + + + + X1:4:DC+ + +4:BU + +X2:7:DC+ + + + + + + X1:5:DC- + +5:WHBU + +X2:8:DC- + + + + + + X1:6:DB- + +6:OG + +X2:2:DB- + + + + + + X1:7:DD+ + +7:WHBN + +X2:4:DD+ + + + + + + X1:8:DD- + +8:BN + +X2:5:DD- + + + + + +  X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + - + X2 - - -X2 - -Stewart Connector SS-37000-002 - -male - -8-pin - -1 - -DB+ - -2 - -DB- - -3 - -DA+ - -4 - -DD+ - -5 - -DD- - -6 - -DA- - -7 - -DC+ - -8 - -DC- + + + +X2 + +Stewart Connector SS-37000-002 + +male + +8-pin + +1 + +DB+ + +2 + +DB- + +3 + +DA+ + +4 + +DD+ + +5 + +DD- + +6 + +DA- + +7 + +DC+ + +8 + +DC- - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + diff --git a/examples/ex10.tsv b/examples/ex10.tsv new file mode 100644 index 000000000..91e69d29c --- /dev/null +++ b/examples/ex10.tsv @@ -0,0 +1,3 @@ +# Qty Unit Description Designators +1 2 Connector, Stewart Connector SS-37000-002, male, 8 pins X1, X2 +2 1 m Cable, CAT5e, 8 x 24 AWG W1 diff --git a/examples/ex10_wv_gvpr.gvpr b/examples/ex10_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex10_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex11.gv b/examples/ex11.gv index 0762860b3..0cdcce933 100644 --- a/examples/ex11.gv +++ b/examples/ex11.gv @@ -1,191 +1,263 @@ graph { -// Graph generated by WireViz 0.4-dev +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] AUTOGENERATED_F_1 [label=< - - +
- - - - -
FerruleGY
-
+ + +
+ + + + + + +
FerruleGY
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_2 [label=< - - +
- - - - -
FerruleGY
-
+ + +
+ + + + + + +
FerruleGY
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_3 [label=< - - +
- - - - -
FerruleGY
-
+ + +
+ + + + + + +
FerruleGY
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_4 [label=< - - +
- - - - -
FerruleGY
-
+ + +
+ + + + + + +
FerruleGY
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X1 [label=< - - - - +
- - -
X1
-
- - - - - - -
Screw connectormale4-pinGN
-
- - - - - - - - - - - - - - - - - -
1A
2B
3C
4D
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + + + +
Screw connectormale4-pinGN
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1A
2B
3C
4D
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
4xBK
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
1:BK
+ + + + + + + + + + +
+
2:WH
+ + + + + + + + + + +
+
3:BU
+ + + + + + + + + + +
+
4:BN
+ + + + + + + + + + +
+
 
+
+> shape=box style=filled] edge [color="#000000:#000000:#000000"] W1:w1:e -- AUTOGENERATED_F_1:w - edge [color="#000000:#ffffff:#000000"] + edge [color="#000000:#FFFFFF:#000000"] W1:w2:e -- AUTOGENERATED_F_2:w - edge [color="#000000:#0066ff:#000000"] + edge [color="#000000:#0066FF:#000000"] W1:w3:e -- AUTOGENERATED_F_3:w edge [color="#000000:#895956:#000000"] W1:w4:e -- AUTOGENERATED_F_4:w - W1 [label=< - - - - -
- - -
W1
-
- - - - -
4xBK
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- 1:BK -
- - - - -
-
- 2:WH -
- - - - -
-
- 3:BU -
- - - - -
-
- 4:BN -
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] + W1:w1:e -- W1:w1:w [color="#000000:#000000:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#0066FF:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#895956:#000000" straight=straight] edge [color="#000000" dir=forward style=dashed] - AUTOGENERATED_F_1:e -- X1:p1l:w + AUTOGENERATED_F_1:p1r:e -- X1:p1l:w edge [color="#000000" dir=forward style=dashed] - AUTOGENERATED_F_2:e -- X1:p2l:w + AUTOGENERATED_F_2:p1r:e -- X1:p2l:w edge [color="#000000" dir=forward style=dashed] - AUTOGENERATED_F_3:e -- X1:p3l:w + AUTOGENERATED_F_3:p1r:e -- X1:p3l:w edge [color="#000000" dir=forward style=dashed] - AUTOGENERATED_F_4:e -- X1:p4l:w + AUTOGENERATED_F_4:p1r:e -- X1:p4l:w } diff --git a/examples/ex11.html b/examples/ex11.html index 9f2a3e7d5..c73befb6e 100644 --- a/examples/ex11.html +++ b/examples/ex11.html @@ -1,7 +1,7 @@ - + ex11 - +

ex11

Diagram

@@ -30,172 +30,222 @@

Diagram

- - - - + + + AUTOGENERATED_F_1 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + X1 - - -X1 - -Screw connector - -male - -4-pin - -GN - - - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + +X1 + +Screw connector + +male + +4-pin + +GN + + + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + AUTOGENERATED_F_1:e--X1:w - - + + - + AUTOGENERATED_F_2 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_2:e--X1:w - - + + - + AUTOGENERATED_F_3 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_3:e--X1:w - - + + - + AUTOGENERATED_F_4 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_4:e--X1:w - - + + W1 - - -W1 - -4x - -BK - - -  -     1:BK     - - - -     2:WH     - - - -     3:BU     - - - -     4:BN     - - - -  + + + +W1 + +4x + +BK + + +  + + +1:BK + + + + + + + +2:WH + + + + + + + +3:BU + + + + + + + +4:BN + + + + + +  - + W1:e--AUTOGENERATED_F_1:w - - - + + + - + W1:e--AUTOGENERATED_F_2:w - - - + + + - + W1:e--AUTOGENERATED_F_3:w - - - + + + - + W1:e--AUTOGENERATED_F_4:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + @@ -211,33 +261,29 @@

Bill of Materials

- - + - + - - - - - - - - - + - + - - + - + + + + + + +
IdDescription# QtyUnitDescription Designators
1Cable, 4 wires, BK0mW1
2Connector, Ferrule, GY1 4Connector, Ferrule, GY
3Connector, Screw connector, male, 4 pins, GN2 1Connector, Screw connector, male, 4 pins, GN X1
31Cable, 4 wires, BKW1
diff --git a/examples/ex11.png b/examples/ex11.png index 1f572f08d..1d970a836 100644 Binary files a/examples/ex11.png and b/examples/ex11.png differ diff --git a/examples/ex11.svg b/examples/ex11.svg index 466cb758f..23775b748 100644 --- a/examples/ex11.svg +++ b/examples/ex11.svg @@ -1,172 +1,222 @@ - - - - + + + AUTOGENERATED_F_1 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + X1 - - -X1 - -Screw connector - -male - -4-pin - -GN - - - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + +X1 + +Screw connector + +male + +4-pin + +GN + + + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + AUTOGENERATED_F_1:e--X1:w - - + + - + AUTOGENERATED_F_2 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_2:e--X1:w - - + + - + AUTOGENERATED_F_3 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_3:e--X1:w - - + + - + AUTOGENERATED_F_4 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_4:e--X1:w - - + + W1 - - -W1 - -4x - -BK - - -  -     1:BK     - - - -     2:WH     - - - -     3:BU     - - - -     4:BN     - - - -  + + + +W1 + +4x + +BK + + +  + + +1:BK + + + + + + + +2:WH + + + + + + + +3:BU + + + + + + + +4:BN + + + + + +  - + W1:e--AUTOGENERATED_F_1:w - - - + + + - + W1:e--AUTOGENERATED_F_2:w - - - + + + - + W1:e--AUTOGENERATED_F_3:w - - - + + + - + W1:e--AUTOGENERATED_F_4:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + diff --git a/examples/ex11.tsv b/examples/ex11.tsv new file mode 100644 index 000000000..a2652b53c --- /dev/null +++ b/examples/ex11.tsv @@ -0,0 +1,4 @@ +# Qty Description Designators +1 4 Connector, Ferrule, GY +2 1 Connector, Screw connector, male, 4 pins, GN X1 +3 1 Cable, 4 wires, BK W1 diff --git a/examples/ex11_wv_gvpr.gvpr b/examples/ex11_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex11_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex12.gv b/examples/ex12.gv index c5429861e..c0cbbb876 100644 --- a/examples/ex12.gv +++ b/examples/ex12.gv @@ -1,269 +1,401 @@ graph { -// Graph generated by WireViz 0.4-dev +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - - - -
Dupont 2.54mmmale5-pinBK
-
- - - - - - - - - - - - - - - - -
1
2
3
4
5
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + + + +
Dupont 2.54mmmale5-pinBK
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1
2
3
4
5
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - - - -
Dupont 2.54mmfemale5-pinBK
-
- - - - - - - - - - - - - - - - -
1
2
3
4
5
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + + + +
Dupont 2.54mmfemale5-pinBK
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
1
2
3
4
5
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ff0000:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + +
4x0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
RD X1:1
+ + + + + + + + + + +
+
BK X1:2
+ + + + + + + + + + +
+
BU X1:3
+ + + + + + + + + + +
+
GN X1:4
+ + + + + + + + + + +
+
 
+
+> shape=box style="filled,dashed"] + edge [color="#000000:#FF0000:#000000"] W1:w1:e -- X1:p1l:w edge [color="#000000:#000000:#000000"] W1:w2:e -- X1:p2l:w - edge [color="#000000:#0066ff:#000000"] + edge [color="#000000:#0066FF:#000000"] W1:w3:e -- X1:p3l:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] W1:w4:e -- X1:p4l:w - W1 [label=< - - - - + W1:w1:e -- W1:w1:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#000000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#0066FF:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#00AA00:#000000" straight=straight] + W2 [label=< +
- - -
W1
-
- - - -
4x0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- RD - X1:1
- - - - -
-
- BK - X1:2
- - - - -
-
- BU - X1:3
- - - - -
-
- GN - X1:4
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W2
+
+ + + + + +
4x0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X2:1 RD
+ + + + + + + + + + +
+
X2:2 BK
+ + + + + + + + + + +
+
X2:3 BU
+ + + + + + + + + + +
+
X2:4 GN
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] - edge [color="#000000:#ff0000:#000000"] +> shape=box style="filled,dashed"] + edge [color="#000000:#FF0000:#000000"] X2:p1r:e -- W2:w1:w edge [color="#000000:#000000:#000000"] X2:p2r:e -- W2:w2:w - edge [color="#000000:#0066ff:#000000"] + edge [color="#000000:#0066FF:#000000"] X2:p3r:e -- W2:w3:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] X2:p4r:e -- W2:w4:w - W2 [label=< - - - - -
- - -
W2
-
- - - -
4x0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X2:1 - RD -
- - - - -
-
X2:2 - BK -
- - - - -
-
X2:3 - BU -
- - - - -
-
X2:4 - GN -
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] - edge [color="#000000:#000000" dir=forward style=dashed] + W2:w1:e -- W2:w1:w [color="#000000:#FF0000:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#000000:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#0066FF:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#00AA00:#000000" straight=straight] + edge [color="#000000" dir=forward style=dashed] X1:e -- X2:w } diff --git a/examples/ex12.html b/examples/ex12.html index e3d983cbb..5d4b2da42 100644 --- a/examples/ex12.html +++ b/examples/ex12.html @@ -1,7 +1,7 @@ - + ex12 - +

ex12

Diagram

@@ -30,195 +30,278 @@

Diagram

- - - - + + + X1 - - -X1 - -Dupont 2.54mm - -male - -5-pin - -BK - - - -1 - -2 - -3 - -4 - -5 + + + +X1 + +Dupont 2.54mm + +male + +5-pin + +BK + + + +1 + +2 + +3 + +4 + +5 X2 - - -X2 - -Dupont 2.54mm - -female - -5-pin - -BK - - - -1 - -2 - -3 - -4 - -5 + + + +X2 + +Dupont 2.54mm + +female + +5-pin + +BK + + + +1 + +2 + +3 + +4 + +5 - + X1:e--X2:w - - - + + - + W2 - - -W2 - -4x - -0.2 m -  -X2:1 -     RD     - - - -X2:2 -     BK     - - - -X2:3 -     BU     - - - -X2:4 -     GN     - - - -  + + + +W2 + +4x + +0.2 m +  + X2:1 + +RD + + + + + + X2:2 + +BK + + + + + + X2:3 + +BU + + + + + + X2:4 + +GN + + + + + +  - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + - + W1 - - -W1 - -4x - -0.2 m -  -     RD     -X1:1 - - - -     BK     -X1:2 - - - -     BU     -X1:3 - - - -     GN     -X1:4 - - - -  + + + +W1 + +4x + +0.2 m +  + + +RD + +X1:1 + + + + + +BK + +X1:2 + + + + + +BU + +X1:3 + + + + + +GN + +X1:4 + + + +  - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + @@ -234,52 +317,52 @@

Bill of Materials

- - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + +
IdDescription# Qty UnitDescription Designators
1Connector, Dupont 2.54mm, female, 5 pins, BK1 1 Connector, Dupont 2.54mm, female, 5 pins, BK X2
2Connector, Dupont 2.54mm, male, 5 pins, BK2 1 Connector, Dupont 2.54mm, male, 5 pins, BK X1
3Wire, BK0.432 mWire, BK W1, W2
4Wire, BU0.442 mWire, BU W1, W2
5Wire, GN0.452 mWire, GN W1, W2
6Wire, RD0.462 mWire, RD W1, W2
diff --git a/examples/ex12.png b/examples/ex12.png index bc0fce6c5..dcaddbefa 100644 Binary files a/examples/ex12.png and b/examples/ex12.png differ diff --git a/examples/ex12.svg b/examples/ex12.svg index 1f9f645ba..f1f5402ca 100644 --- a/examples/ex12.svg +++ b/examples/ex12.svg @@ -1,195 +1,278 @@ - - - - + + + X1 - - -X1 - -Dupont 2.54mm - -male - -5-pin - -BK - - - -1 - -2 - -3 - -4 - -5 + + + +X1 + +Dupont 2.54mm + +male + +5-pin + +BK + + + +1 + +2 + +3 + +4 + +5 X2 - - -X2 - -Dupont 2.54mm - -female - -5-pin - -BK - - - -1 - -2 - -3 - -4 - -5 + + + +X2 + +Dupont 2.54mm + +female + +5-pin + +BK + + + +1 + +2 + +3 + +4 + +5 - + X1:e--X2:w - - - + + - + W2 - - -W2 - -4x - -0.2 m -  -X2:1 -     RD     - - - -X2:2 -     BK     - - - -X2:3 -     BU     - - - -X2:4 -     GN     - - - -  + + + +W2 + +4x + +0.2 m +  + X2:1 + +RD + + + + + + X2:2 + +BK + + + + + + X2:3 + +BU + + + + + + X2:4 + +GN + + + + + +  - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + - + W1 - - -W1 - -4x - -0.2 m -  -     RD     -X1:1 - - - -     BK     -X1:2 - - - -     BU     -X1:3 - - - -     GN     -X1:4 - - - -  + + + +W1 + +4x + +0.2 m +  + + +RD + +X1:1 + + + + + +BK + +X1:2 + + + + + +BU + +X1:3 + + + + + +GN + +X1:4 + + + +  - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + diff --git a/examples/ex12.tsv b/examples/ex12.tsv new file mode 100644 index 000000000..cafd8fe5e --- /dev/null +++ b/examples/ex12.tsv @@ -0,0 +1,7 @@ +# Qty Unit Description Designators +1 1 Connector, Dupont 2.54mm, female, 5 pins, BK X2 +2 1 Connector, Dupont 2.54mm, male, 5 pins, BK X1 +3 2 m Wire, BK W1, W2 +4 2 m Wire, BU W1, W2 +5 2 m Wire, GN W1, W2 +6 2 m Wire, RD W1, W2 diff --git a/examples/ex12_wv_gvpr.gvpr b/examples/ex12_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex12_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex13.gv b/examples/ex13.gv index b26897ac7..2ea10dd66 100644 --- a/examples/ex13.gv +++ b/examples/ex13.gv @@ -1,433 +1,617 @@ graph { -// Graph generated by WireViz 0.4-dev +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - -
4-pin
-
- - - - - - - - - - - - - - - - - -
A1
B2
C3
D4
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + +
4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
A1
B2
C3
D4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] F1 [label=< - - +
- - -
ferrule
-
+ + +
+ + + + +
ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] F2 [label=< - - +
- - -
ferrule
-
+ + +
+ + + + +
ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] F3 [label=< - - +
- - -
ferrule
-
+ + +
+ + + + +
ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] F4 [label=< - - +
- - -
ferrule
-
+ + +
+ + + + +
ferrule
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - -
4-pin
-
- - - - - - - - - - - - - - - - - -
1A
2B
3C
4D
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + +
4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1A
2B
3C
4D
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X3 [label=< - - - - +
- - -
X3
-
- - -
4-pin
-
- - - - - - - - - - - - - - - - - -
1A
2B
3C
4D
-
+ + + + + + + + +
+ + + + +
X3
+
+ + + + +
4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1A
2B
3C
4D
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + C1 [label=< + + + + + + + + + + +
+ + + + +
C1
+
+ + + + +
4x
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:A 1:WH F1
+ + + + + + + + + + +
+
X1:2:B 2:BN F2
+ + + + + + + + + + +
+
X1:3:C 3:GN F3
+ + + + + + + + + + +
+
X1:4:D 4:YE F4
+ + + + + + + + + + +
+
 
+
+> shape=box style=filled] + edge [color="#000000:#FFFFFF:#000000"] X1:p1r:e -- C1:w1:w C1:w1:e -- F1:w edge [color="#000000:#895956:#000000"] X1:p2r:e -- C1:w2:w C1:w2:e -- F2:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] X1:p3r:e -- C1:w3:w C1:w3:e -- F3:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X1:p4r:e -- C1:w4:w C1:w4:e -- F4:w - C1 [label=< - - - - + C1:w1:e -- C1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + C1:w2:e -- C1:w2:w [color="#000000:#895956:#000000" straight=straight] + C1:w3:e -- C1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + C1:w4:e -- C1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + C2 [label=< +
- - -
C1
-
- - -
4x
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1:A - 1:WH -
- - - - -
-
X1:2:B - 2:BN -
- - - - -
-
X1:3:C - 3:GN -
- - - - -
-
X1:4:D - 4:YE -
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
C2
+
+ + + + +
4x
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
F1 1:WH X2:1:A
+ + + + + + + + + + +
+
F2 2:BN X2:2:B
+ + + + + + + + + + +
+
F3 3:GN X2:3:C
+ + + + + + + + + + +
+
F4 4:YE X2:4:D
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + edge [color="#000000:#FFFFFF:#000000"] F1:e -- C2:w1:w C2:w1:e -- X2:p1l:w edge [color="#000000:#895956:#000000"] F2:e -- C2:w2:w C2:w2:e -- X2:p2l:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] F3:e -- C2:w3:w C2:w3:e -- X2:p3l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] F4:e -- C2:w4:w C2:w4:e -- X2:p4l:w - C2 [label=< - - - - + C2:w1:e -- C2:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + C2:w2:e -- C2:w2:w [color="#000000:#895956:#000000" straight=straight] + C2:w3:e -- C2:w3:w [color="#000000:#00AA00:#000000" straight=straight] + C2:w4:e -- C2:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + C3 [label=< +
- - -
C2
-
- - -
4x
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- 1:WH - X2:1:A
- - - - -
-
- 2:BN - X2:2:B
- - - - -
-
- 3:GN - X2:3:C
- - - - -
-
- 4:YE - X2:4:D
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
C3
+
+ + + + +
4x
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
F1 1:WH X3:1:A
+ + + + + + + + + + +
+
F2 2:BN X3:2:B
+ + + + + + + + + + +
+
F3 3:GN X3:3:C
+ + + + + + + + + + +
+
F4 4:YE X3:4:D
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + edge [color="#000000:#FFFFFF:#000000"] F1:e -- C3:w1:w C3:w1:e -- X3:p1l:w edge [color="#000000:#895956:#000000"] F2:e -- C3:w2:w C3:w2:e -- X3:p2l:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] F3:e -- C3:w3:w C3:w3:e -- X3:p3l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] F4:e -- C3:w4:w C3:w4:e -- X3:p4l:w - C3 [label=< - - - - -
- - -
C3
-
- - -
4x
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- 1:WH - X3:1:A
- - - - -
-
- 2:BN - X3:2:B
- - - - -
-
- 3:GN - X3:3:C
- - - - -
-
- 4:YE - X3:4:D
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] + C3:w1:e -- C3:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + C3:w2:e -- C3:w2:w [color="#000000:#895956:#000000" straight=straight] + C3:w3:e -- C3:w3:w [color="#000000:#00AA00:#000000" straight=straight] + C3:w4:e -- C3:w4:w [color="#000000:#FFFF00:#000000" straight=straight] } diff --git a/examples/ex13.html b/examples/ex13.html index 1e7bbe55a..6845682f9 100644 --- a/examples/ex13.html +++ b/examples/ex13.html @@ -1,7 +1,7 @@ - + ex13 - +

ex13

Diagram

@@ -30,376 +30,506 @@

Diagram

- - - - + + + X1 - - -X1 - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X1 + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + C1 - - -C1 - -4x -  -X1:1:A -     1:WH     - - - -X1:2:B -     2:BN     - - - -X1:3:C -     3:GN     - - - -X1:4:D -     4:YE     - - - -  + + + +C1 + +4x +  + X1:1:A + +1:WH + +F1 + + + + X1:2:B + +2:BN + +F2 + + + + X1:3:C + +3:GN + +F3 + + + + X1:4:D + +4:YE + +F4 + + + +  X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + - + F1 - - -ferrule + + + +ferrule + + + +C1:e--F1:w + + + + + + +F2 + + + +ferrule + + + +C1:e--F2:w + + + + + + +F3 + + + +ferrule + + + +C1:e--F3:w + + + + + + +F4 + + + +ferrule + + + +C1:e--F4:w + + + - + C2 - - -C2 - -4x -  -     1:WH     -X2:1:A - - - -     2:BN     -X2:2:B - - - -     3:GN     -X2:3:C - - - -     4:YE     -X2:4:D - - - -  + + + +C2 + +4x +  + F1 + +1:WH + +X2:1:A + + + + F2 + +2:BN + +X2:2:B + + + + F3 + +3:GN + +X2:3:C + + + + F4 + +4:YE + +X2:4:D + + + +  - + F1:e--C2:w - - - + + + - + C3 - - -C3 - -4x -  -     1:WH     -X3:1:A - - - -     2:BN     -X3:2:B - - - -     3:GN     -X3:3:C - - - -     4:YE     -X3:4:D - - - -  + + + +C3 + +4x +  + F1 + +1:WH + +X3:1:A + + + + F2 + +2:BN + +X3:2:B + + + + F3 + +3:GN + +X3:3:C + + + + F4 + +4:YE + +X3:4:D + + + +  - + F1:e--C3:w - - - - - - -F2 - - -ferrule + + + - + F2:e--C2:w - - - + + + - + F2:e--C3:w - - - - - - -F3 - - -ferrule + + + - + F3:e--C2:w - - - + + + - + F3:e--C3:w - - - - - - -F4 - - -ferrule + + + - + F4:e--C2:w - - - + + + - + F4:e--C3:w - - - - - - -X2 - - -X2 - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + - - -X3 - - -X3 - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + +C2:e--C2:w + + + - - -C1:e--F1:w - - - + + +C2:e--C2:w + + + - - -C1:e--F2:w - - - + + +C2:e--C2:w + + + - - -C1:e--F3:w - - - + + +C2:e--C2:w + + + - - -C1:e--F4:w - - - + + +X2 + + + +X2 + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +X3 + + + +X3 + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + @@ -415,32 +545,28 @@

Bill of Materials

- - + - + - - - - - - - - - + - + - - + - - + + + + + + + +
IdDescription# QtyUnitDescription Designators
1Cable, 4 wires0mC1, C2, C3
2Connector, 4 pins1 3Connector, 4 pins X1, X2, X3
3Connector, ferrule2 4Connector, ferruleF1, F2, F3, F4
33Cable, 4 wiresC1, C2, C3
diff --git a/examples/ex13.png b/examples/ex13.png index 9b24caff7..6261f9448 100644 Binary files a/examples/ex13.png and b/examples/ex13.png differ diff --git a/examples/ex13.svg b/examples/ex13.svg index cf6f37934..2bbb64f7f 100644 --- a/examples/ex13.svg +++ b/examples/ex13.svg @@ -1,376 +1,506 @@ - - - - + + + X1 - - -X1 - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X1 + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + C1 - - -C1 - -4x -  -X1:1:A -     1:WH     - - - -X1:2:B -     2:BN     - - - -X1:3:C -     3:GN     - - - -X1:4:D -     4:YE     - - - -  + + + +C1 + +4x +  + X1:1:A + +1:WH + +F1 + + + + X1:2:B + +2:BN + +F2 + + + + X1:3:C + +3:GN + +F3 + + + + X1:4:D + +4:YE + +F4 + + + +  X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + - + F1 - - -ferrule + + + +ferrule + + + +C1:e--F1:w + + + + + + +F2 + + + +ferrule + + + +C1:e--F2:w + + + + + + +F3 + + + +ferrule + + + +C1:e--F3:w + + + + + + +F4 + + + +ferrule + + + +C1:e--F4:w + + + - + C2 - - -C2 - -4x -  -     1:WH     -X2:1:A - - - -     2:BN     -X2:2:B - - - -     3:GN     -X2:3:C - - - -     4:YE     -X2:4:D - - - -  + + + +C2 + +4x +  + F1 + +1:WH + +X2:1:A + + + + F2 + +2:BN + +X2:2:B + + + + F3 + +3:GN + +X2:3:C + + + + F4 + +4:YE + +X2:4:D + + + +  - + F1:e--C2:w - - - + + + - + C3 - - -C3 - -4x -  -     1:WH     -X3:1:A - - - -     2:BN     -X3:2:B - - - -     3:GN     -X3:3:C - - - -     4:YE     -X3:4:D - - - -  + + + +C3 + +4x +  + F1 + +1:WH + +X3:1:A + + + + F2 + +2:BN + +X3:2:B + + + + F3 + +3:GN + +X3:3:C + + + + F4 + +4:YE + +X3:4:D + + + +  - + F1:e--C3:w - - - - - - -F2 - - -ferrule + + + - + F2:e--C2:w - - - + + + - + F2:e--C3:w - - - - - - -F3 - - -ferrule + + + - + F3:e--C2:w - - - + + + - + F3:e--C3:w - - - - - - -F4 - - -ferrule + + + - + F4:e--C2:w - - - + + + - + F4:e--C3:w - - - - - - -X2 - - -X2 - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + - - -X3 - - -X3 - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + +C2:e--C2:w + + + - - -C1:e--F1:w - - - + + +C2:e--C2:w + + + - - -C1:e--F2:w - - - + + +C2:e--C2:w + + + - - -C1:e--F3:w - - - + + +C2:e--C2:w + + + - - -C1:e--F4:w - - - + + +X2 + + + +X2 + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +X3 + + + +X3 + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + diff --git a/examples/ex13.tsv b/examples/ex13.tsv new file mode 100644 index 000000000..92c458f65 --- /dev/null +++ b/examples/ex13.tsv @@ -0,0 +1,4 @@ +# Qty Description Designators +1 3 Connector, 4 pins X1, X2, X3 +2 4 Connector, ferrule F1, F2, F3, F4 +3 3 Cable, 4 wires C1, C2, C3 diff --git a/examples/ex13_wv_gvpr.gvpr b/examples/ex13_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex13_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex14.gv b/examples/ex14.gv index 4f24330e6..875f1b17b 100644 --- a/examples/ex14.gv +++ b/examples/ex14.gv @@ -1,717 +1,1006 @@ graph { -// Graph generated by WireViz 0.4-dev +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
JST SMmale4-pin
-
- - - - - - - - - - - - - - - - - -
A1
B2
C3
D4
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
JST SMmale4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
A1
B2
C3
D4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_S_1 [label=< - - +
- - - - -
SpliceCU
-
+ + +
+ + + + + + +
SpliceCU
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_S_2 [label=< - - +
- - - - -
SpliceCU
-
+ + +
+ + + + + + +
SpliceCU
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] S1 [label=< - - +
- - - - -
SpliceCU
-
+ + +
+ + + + + + +
SpliceCU
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_S_3 [label=< - - +
- - - - -
SpliceCU
-
+ + +
+ + + + + + +
SpliceCU
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_S_4 [label=< - - +
- - - - -
SpliceCU
-
+ + +
+ + + + + + +
SpliceCU
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_S_5 [label=< - - +
- - - - -
SpliceCU
-
+ + +
+ + + + + + +
SpliceCU
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_S_6 [label=< - - +
- - - - -
SpliceCU
-
+ + +
+ + + + + + +
SpliceCU
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_S_7 [label=< - - +
- - - - -
SpliceCU
-
+ + +
+ + + + + + +
SpliceCU
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - -
JST SMfemale4-pin
-
- - - - - - - - - - - - - - - - - -
1A
2B
3C
4D
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
JST SMfemale4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1A
2B
3C
4D
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X3 [label=< - - - - +
- - -
X3
-
- - - - -
JST SMmale4-pin
-
- - - - - - - - - - - - - - - - - -
A1
B2
C3
D4
-
+ + + + + + + + +
+ + + + +
X3
+
+ + + + + + +
JST SMmale4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
A1
B2
C3
D4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_1 [label=< - - +
- - - - -
FerruleGY
-
+ + +
+ + + + + + +
FerruleGY
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_2 [label=< - - +
- - - - -
FerruleGY
-
+ + +
+ + + + + + +
FerruleGY
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_3 [label=< - - +
- - - - -
FerruleGY
-
+ + +
+ + + + + + +
FerruleGY
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_4 [label=< - - +
- - - - -
FerruleGY
-
+ + +
+ + + + + + +
FerruleGY
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X4 [label=< - - - - +
- - -
X4
-
- - - - - -
Screw terminal connector4-pinGN
-
- - - - - - - - - - - - - - - - - -
1W
2X
3Y
4Z
-
+ + + + + + + + +
+ + + + +
X4
+
+ + + + + + + +
Screw terminal connector4-pinGN
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1W
2X
3Y
4Z
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + +
4x0.1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:4:D 1:WH
+ + + + + + + + + + +
+
X1:3:C 2:BN
+ + + + + + + + + + +
+
X1:2:B 3:GN S1
+ + + + + + + + + + +
+
X1:1:A 4:YE
+ + + + + + + + + + +
+
 
+
+> shape=box style=filled] + edge [color="#000000:#FFFFFF:#000000"] X1:p4r:e -- W1:w1:w W1:w1:e -- AUTOGENERATED_S_1:w edge [color="#000000:#895956:#000000"] X1:p3r:e -- W1:w2:w W1:w2:e -- AUTOGENERATED_S_2:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] X1:p2r:e -- W1:w3:w W1:w3:e -- S1:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X1:p1r:e -- W1:w4:w W1:w4:e -- AUTOGENERATED_S_3:w - W1 [label=< - - - - + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W2 [label=< +
- - -
W1
-
- - - -
4x0.1 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:4:D - 1:WH -
- - - - -
-
X1:3:C - 2:BN -
- - - - -
-
X1:2:B - 3:GN -
- - - - -
-
X1:1:A - 4:YE -
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W2
+
+ + + + + +
4x0.1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
1:WH
+ + + + + + + + + + +
+
2:BN
+ + + + + + + + + + +
+
S1 3:GN
+ + + + + + + + + + +
+
4:YE
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + edge [color="#000000:#FFFFFF:#000000"] AUTOGENERATED_S_1:e -- W2:w1:w W2:w1:e -- AUTOGENERATED_S_4:w edge [color="#000000:#895956:#000000"] AUTOGENERATED_S_2:e -- W2:w2:w W2:w2:e -- AUTOGENERATED_S_5:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] S1:e -- W2:w3:w W2:w3:e -- AUTOGENERATED_S_6:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] AUTOGENERATED_S_3:e -- W2:w4:w W2:w4:e -- AUTOGENERATED_S_7:w - W2 [label=< - - - - + W2:w1:e -- W2:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#895956:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W21 [label=< +
- - -
W2
-
- - - -
4x0.1 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- 1:WH -
- - - - -
-
- 2:BN -
- - - - -
-
- 3:GN -
- - - - -
-
- 4:YE -
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W21
+
+ + + + + +
4x0.1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
1:WH X2:1:A
+ + + + + + + + + + +
+
2:BN X2:2:B
+ + + + + + + + + + +
+
3:GN X2:3:C
+ + + + + + + + + + +
+
4:YE X2:4:D
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + edge [color="#000000:#FFFFFF:#000000"] AUTOGENERATED_S_4:e -- W21:w1:w W21:w1:e -- X2:p1l:w edge [color="#000000:#895956:#000000"] AUTOGENERATED_S_5:e -- W21:w2:w W21:w2:e -- X2:p2l:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] AUTOGENERATED_S_6:e -- W21:w3:w W21:w3:e -- X2:p3l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] AUTOGENERATED_S_7:e -- W21:w4:w W21:w4:e -- X2:p4l:w - W21 [label=< - - - - + W21:w1:e -- W21:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W21:w2:e -- W21:w2:w [color="#000000:#895956:#000000" straight=straight] + W21:w3:e -- W21:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W21:w4:e -- W21:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W3 [label=< +
- - -
W21
-
- - - -
4x0.1 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- 1:WH - X2:1:A
- - - - -
-
- 2:BN - X2:2:B
- - - - -
-
- 3:GN - X2:3:C
- - - - -
-
- 4:YE - X2:4:D
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W3
+
+ + + + + +
4x0.1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X3:1:A 1:WH
+ + + + + + + + + + +
+
X3:2:B 2:BN
+ + + + + + + + + + +
+
X3:3:C 3:GN
+ + + + + + + + + + +
+
X3:4:D 4:YE
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + edge [color="#000000:#FFFFFF:#000000"] X3:p1r:e -- W3:w1:w W3:w1:e -- AUTOGENERATED_F_1:w edge [color="#000000:#895956:#000000"] X3:p2r:e -- W3:w2:w W3:w2:e -- AUTOGENERATED_F_2:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] X3:p3r:e -- W3:w3:w W3:w3:e -- AUTOGENERATED_F_3:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X3:p4r:e -- W3:w4:w W3:w4:e -- AUTOGENERATED_F_4:w - W3 [label=< - - - - + W3:w1:e -- W3:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W3:w2:e -- W3:w2:w [color="#000000:#895956:#000000" straight=straight] + W3:w3:e -- W3:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W3:w4:e -- W3:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + AUTOGENERATED_WIRE_1 [label=< +
- - -
W3
-
- - - -
4x0.1 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X3:1:A - 1:WH -
- - - - -
-
X3:2:B - 2:BN -
- - - - -
-
X3:3:C - 3:GN -
- - - - -
-
X3:4:D - 4:YE -
- - - - -
-
 
-
+ + + + + +
+ + + + + +
1x0.1 m
+
+ + + + + + + + + + + + + + + + + +
 
S1 1:BK X2:4:D
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] edge [color="#000000:#000000:#000000"] S1:e -- AUTOGENERATED_WIRE_1:w1:w AUTOGENERATED_WIRE_1:w1:e -- X2:p4l:w - AUTOGENERATED_WIRE_1 [label=< - - - -
- - - -
1x0.1 m
-
- - - - - - - - - - - -
 
- 1:BK - X2:4:D
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#000000" dir=both style=dashed] + AUTOGENERATED_WIRE_1:w1:e -- AUTOGENERATED_WIRE_1:w1:w [color="#000000:#000000:#000000" straight=straight] + edge [color="#000000" dir=both style=dashed] X2:e -- X3:w edge [color="#000000" dir=forward style=dashed] - AUTOGENERATED_F_1:e -- X4:p2l:w + AUTOGENERATED_F_1:p1r:e -- X4:p2l:w edge [color="#000000" dir=forward style=dashed] - AUTOGENERATED_F_2:e -- X4:p1l:w + AUTOGENERATED_F_2:p1r:e -- X4:p1l:w edge [color="#000000" dir=forward style=dashed] - AUTOGENERATED_F_3:e -- X4:p4l:w + AUTOGENERATED_F_3:p1r:e -- X4:p4l:w edge [color="#000000" dir=forward style=dashed] - AUTOGENERATED_F_4:e -- X4:p3l:w + AUTOGENERATED_F_4:p1r:e -- X4:p3l:w } diff --git a/examples/ex14.html b/examples/ex14.html index e20c23261..d31f80451 100644 --- a/examples/ex14.html +++ b/examples/ex14.html @@ -1,7 +1,7 @@ - + ex14 - +

ex14

Diagram

@@ -30,676 +30,870 @@

Diagram

- - - - + + + X1 - - -X1 - -JST SM - -male - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X1 + +JST SM + +male + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + W1 - - -W1 - -4x - -0.1 m -  -X1:4:D -     1:WH     - - - -X1:3:C -     2:BN     - - - -X1:2:B -     3:GN     - - - -X1:1:A -     4:YE     - - - -  + + + +W1 + +4x + +0.1 m +  + X1:4:D + +1:WH + + + + + + X1:3:C + +2:BN + + + + + + X1:2:B + +3:GN + +S1 + + + + X1:1:A + +4:YE + + + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + AUTOGENERATED_S_1 - - -Splice - -CU - - + + + +Splice + +CU + + - - -W2 - - -W2 - -4x - -0.1 m -  -     1:WH     - - - -     2:BN     - - - -     3:GN     - - - -     4:YE     - - - -  - - + -AUTOGENERATED_S_1:e--W2:w - - - +W1:e--AUTOGENERATED_S_1:w + + + - + AUTOGENERATED_S_2 - - -Splice - -CU - - + + + +Splice + +CU + + - - -AUTOGENERATED_S_2:e--W2:w - - - + + +W1:e--AUTOGENERATED_S_2:w + + + - + S1 - - -Splice - -CU - - + + + +Splice + +CU + + - + + +W1:e--S1:w + + + + + + +AUTOGENERATED_S_3 + + + +Splice + +CU + + + + + +W1:e--AUTOGENERATED_S_3:w + + + + + + +W2 + + + +W2 + +4x + +0.1 m +  + + +1:WH + + + + + + + +2:BN + + + + + + S1 + +3:GN + + + + + + + +4:YE + + + + + +  + + +AUTOGENERATED_S_1:e--W2:w + + + + + + +AUTOGENERATED_S_2:e--W2:w + + + + + + S1:e--W2:w - - - + + + - + AUTOGENERATED_WIRE_1 - - -1x - -0.1 m -  -     1:BK     -X2:4:D - - - -  + + + +1x + +0.1 m +  + S1 + +1:BK + +X2:4:D + + + +  - + S1:e--AUTOGENERATED_WIRE_1:w - - - - - - -AUTOGENERATED_S_3 - - -Splice - -CU - - + + + - + AUTOGENERATED_S_3:e--W2:w - - - + + + - - -AUTOGENERATED_S_4 - - -Splice - -CU - - + + +W2:e--W2:w + + + - - -W21 - - -W21 - -4x - -0.1 m -  -     1:WH     -X2:1:A - - - -     2:BN     -X2:2:B - - - -     3:GN     -X2:3:C - - - -     4:YE     -X2:4:D - - - -  + + +W2:e--W2:w + + + - + + +W2:e--W2:w + + + + + -AUTOGENERATED_S_4:e--W21:w - - - +W2:e--W2:w + + + + + + +AUTOGENERATED_S_4 + + + +Splice + +CU + + + + + +W2:e--AUTOGENERATED_S_4:w + + + - + AUTOGENERATED_S_5 - - -Splice - -CU - - + + + +Splice + +CU + + - + -AUTOGENERATED_S_5:e--W21:w - - - +W2:e--AUTOGENERATED_S_5:w + + + - + AUTOGENERATED_S_6 - - -Splice - -CU - - + + + +Splice + +CU + + - - -AUTOGENERATED_S_6:e--W21:w - - - + + +W2:e--AUTOGENERATED_S_6:w + + + - + AUTOGENERATED_S_7 - - -Splice - -CU - - + + + +Splice + +CU + + + + + +W2:e--AUTOGENERATED_S_7:w + + + + + + +W21 + + + +W21 + +4x + +0.1 m +  + + +1:WH + +X2:1:A + + + + + +2:BN + +X2:2:B + + + + + +3:GN + +X2:3:C + + + + + +4:YE + +X2:4:D + + + +  + + + +AUTOGENERATED_S_4:e--W21:w + + + + + + +AUTOGENERATED_S_5:e--W21:w + + + + + + +AUTOGENERATED_S_6:e--W21:w + + + - + AUTOGENERATED_S_7:e--W21:w - - - + + + + + + +AUTOGENERATED_WIRE_1:e--AUTOGENERATED_WIRE_1:w + + + - + X2 - - -X2 - -JST SM - -female - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + +X2 + +JST SM + +female + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D + + + +AUTOGENERATED_WIRE_1:e--X2:w + + + - + X3 - - -X3 - -JST SM - -male - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X3 + +JST SM + +male + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + X2:e--X3:w - - - - + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + - + W3 - - -W3 - -4x - -0.1 m -  -X3:1:A -     1:WH     - - - -X3:2:B -     2:BN     - - - -X3:3:C -     3:GN     - - - -X3:4:D -     4:YE     - - - -  + + + +W3 + +4x + +0.1 m +  + X3:1:A + +1:WH + + + + + + X3:2:B + +2:BN + + + + + + X3:3:C + +3:GN + + + + + + X3:4:D + +4:YE + + + + + +  - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + AUTOGENERATED_F_1 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -X4 - - -X4 - -Screw terminal connector - -4-pin - -GN - - - -1 - -W - -2 - -X - -3 - -Y - -4 - -Z - - - -AUTOGENERATED_F_1:e--X4:w - - + + +W3:e--AUTOGENERATED_F_1:w + + + - + AUTOGENERATED_F_2 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -AUTOGENERATED_F_2:e--X4:w - - + + +W3:e--AUTOGENERATED_F_2:w + + + - + AUTOGENERATED_F_3 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -AUTOGENERATED_F_3:e--X4:w - - + + +W3:e--AUTOGENERATED_F_3:w + + + - + AUTOGENERATED_F_4 - - -Ferrule - -GY - - - - - -AUTOGENERATED_F_4:e--X4:w - - - - - -W1:e--AUTOGENERATED_S_1:w - - - - - - -W1:e--AUTOGENERATED_S_2:w - - - - - - -W1:e--S1:w - - - + + + +Ferrule + +GY + + - - -W1:e--AUTOGENERATED_S_3:w - - - - - - -W2:e--AUTOGENERATED_S_4:w - - - - - - -W2:e--AUTOGENERATED_S_5:w - - - - - - -W2:e--AUTOGENERATED_S_6:w - - - - - - -W2:e--AUTOGENERATED_S_7:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - + + +W3:e--AUTOGENERATED_F_4:w + + + - - -W3:e--AUTOGENERATED_F_1:w - - - + + +X4 + + + +X4 + +Screw terminal connector + +4-pin + +GN + + + +1 + +W + +2 + +X + +3 + +Y + +4 + +Z - - -W3:e--AUTOGENERATED_F_2:w - - - + + +AUTOGENERATED_F_1:e--X4:w + + - - -W3:e--AUTOGENERATED_F_3:w - - - + + +AUTOGENERATED_F_2:e--X4:w + + - - -W3:e--AUTOGENERATED_F_4:w - - - + + +AUTOGENERATED_F_3:e--X4:w + + - - -AUTOGENERATED_WIRE_1:e--X2:w - - - + + +AUTOGENERATED_F_4:e--X4:w + + @@ -715,61 +909,61 @@

Bill of Materials

- - + + - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, 1 wires0.1m
2Cable, 4 wires0.4mW1, W2, W21, W3
3Connector, Ferrule, GY1 4 Connector, Ferrule, GY
4Connector, JST SM, female, 4 pins2 1 Connector, JST SM, female, 4 pins X2
5Connector, JST SM, male, 4 pins3 2 Connector, JST SM, male, 4 pins X1, X3
6Connector, Screw terminal connector, 4 pins, GN4 1 Connector, Screw terminal connector, 4 pins, GN X4
7Connector, Splice, CU5 8 Connector, Splice, CUS1
61mCable, 1 wires
74mCable, 4 wiresW1, W2, W21, W3
diff --git a/examples/ex14.png b/examples/ex14.png index bae9a15d3..5f3ea5592 100644 Binary files a/examples/ex14.png and b/examples/ex14.png differ diff --git a/examples/ex14.svg b/examples/ex14.svg index 3f06f5a0f..27c6bfc7d 100644 --- a/examples/ex14.svg +++ b/examples/ex14.svg @@ -1,676 +1,870 @@ - - - - + + + X1 - - -X1 - -JST SM - -male - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X1 + +JST SM + +male + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + W1 - - -W1 - -4x - -0.1 m -  -X1:4:D -     1:WH     - - - -X1:3:C -     2:BN     - - - -X1:2:B -     3:GN     - - - -X1:1:A -     4:YE     - - - -  + + + +W1 + +4x + +0.1 m +  + X1:4:D + +1:WH + + + + + + X1:3:C + +2:BN + + + + + + X1:2:B + +3:GN + +S1 + + + + X1:1:A + +4:YE + + + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + AUTOGENERATED_S_1 - - -Splice - -CU - - + + + +Splice + +CU + + - - -W2 - - -W2 - -4x - -0.1 m -  -     1:WH     - - - -     2:BN     - - - -     3:GN     - - - -     4:YE     - - - -  - - + -AUTOGENERATED_S_1:e--W2:w - - - +W1:e--AUTOGENERATED_S_1:w + + + - + AUTOGENERATED_S_2 - - -Splice - -CU - - + + + +Splice + +CU + + - - -AUTOGENERATED_S_2:e--W2:w - - - + + +W1:e--AUTOGENERATED_S_2:w + + + - + S1 - - -Splice - -CU - - + + + +Splice + +CU + + - + + +W1:e--S1:w + + + + + + +AUTOGENERATED_S_3 + + + +Splice + +CU + + + + + +W1:e--AUTOGENERATED_S_3:w + + + + + + +W2 + + + +W2 + +4x + +0.1 m +  + + +1:WH + + + + + + + +2:BN + + + + + + S1 + +3:GN + + + + + + + +4:YE + + + + + +  + + +AUTOGENERATED_S_1:e--W2:w + + + + + + +AUTOGENERATED_S_2:e--W2:w + + + + + + S1:e--W2:w - - - + + + - + AUTOGENERATED_WIRE_1 - - -1x - -0.1 m -  -     1:BK     -X2:4:D - - - -  + + + +1x + +0.1 m +  + S1 + +1:BK + +X2:4:D + + + +  - + S1:e--AUTOGENERATED_WIRE_1:w - - - - - - -AUTOGENERATED_S_3 - - -Splice - -CU - - + + + - + AUTOGENERATED_S_3:e--W2:w - - - + + + - - -AUTOGENERATED_S_4 - - -Splice - -CU - - + + +W2:e--W2:w + + + - - -W21 - - -W21 - -4x - -0.1 m -  -     1:WH     -X2:1:A - - - -     2:BN     -X2:2:B - - - -     3:GN     -X2:3:C - - - -     4:YE     -X2:4:D - - - -  + + +W2:e--W2:w + + + - + + +W2:e--W2:w + + + + + -AUTOGENERATED_S_4:e--W21:w - - - +W2:e--W2:w + + + + + + +AUTOGENERATED_S_4 + + + +Splice + +CU + + + + + +W2:e--AUTOGENERATED_S_4:w + + + - + AUTOGENERATED_S_5 - - -Splice - -CU - - + + + +Splice + +CU + + - + -AUTOGENERATED_S_5:e--W21:w - - - +W2:e--AUTOGENERATED_S_5:w + + + - + AUTOGENERATED_S_6 - - -Splice - -CU - - + + + +Splice + +CU + + - - -AUTOGENERATED_S_6:e--W21:w - - - + + +W2:e--AUTOGENERATED_S_6:w + + + - + AUTOGENERATED_S_7 - - -Splice - -CU - - + + + +Splice + +CU + + + + + +W2:e--AUTOGENERATED_S_7:w + + + + + + +W21 + + + +W21 + +4x + +0.1 m +  + + +1:WH + +X2:1:A + + + + + +2:BN + +X2:2:B + + + + + +3:GN + +X2:3:C + + + + + +4:YE + +X2:4:D + + + +  + + + +AUTOGENERATED_S_4:e--W21:w + + + + + + +AUTOGENERATED_S_5:e--W21:w + + + + + + +AUTOGENERATED_S_6:e--W21:w + + + - + AUTOGENERATED_S_7:e--W21:w - - - + + + + + + +AUTOGENERATED_WIRE_1:e--AUTOGENERATED_WIRE_1:w + + + - + X2 - - -X2 - -JST SM - -female - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + +X2 + +JST SM + +female + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D + + + +AUTOGENERATED_WIRE_1:e--X2:w + + + - + X3 - - -X3 - -JST SM - -male - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X3 + +JST SM + +male + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + X2:e--X3:w - - - - + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + - + W3 - - -W3 - -4x - -0.1 m -  -X3:1:A -     1:WH     - - - -X3:2:B -     2:BN     - - - -X3:3:C -     3:GN     - - - -X3:4:D -     4:YE     - - - -  + + + +W3 + +4x + +0.1 m +  + X3:1:A + +1:WH + + + + + + X3:2:B + +2:BN + + + + + + X3:3:C + +3:GN + + + + + + X3:4:D + +4:YE + + + + + +  - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + AUTOGENERATED_F_1 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -X4 - - -X4 - -Screw terminal connector - -4-pin - -GN - - - -1 - -W - -2 - -X - -3 - -Y - -4 - -Z - - - -AUTOGENERATED_F_1:e--X4:w - - + + +W3:e--AUTOGENERATED_F_1:w + + + - + AUTOGENERATED_F_2 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -AUTOGENERATED_F_2:e--X4:w - - + + +W3:e--AUTOGENERATED_F_2:w + + + - + AUTOGENERATED_F_3 - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -AUTOGENERATED_F_3:e--X4:w - - + + +W3:e--AUTOGENERATED_F_3:w + + + - + AUTOGENERATED_F_4 - - -Ferrule - -GY - - - - - -AUTOGENERATED_F_4:e--X4:w - - - - - -W1:e--AUTOGENERATED_S_1:w - - - - - - -W1:e--AUTOGENERATED_S_2:w - - - - - - -W1:e--S1:w - - - - - - -W1:e--AUTOGENERATED_S_3:w - - - - - - -W2:e--AUTOGENERATED_S_4:w - - - - - - -W2:e--AUTOGENERATED_S_5:w - - - + + + +Ferrule + +GY + + - - -W2:e--AUTOGENERATED_S_6:w - - - - - - -W2:e--AUTOGENERATED_S_7:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - + + +W3:e--AUTOGENERATED_F_4:w + + + - - -W3:e--AUTOGENERATED_F_1:w - - - + + +X4 + + + +X4 + +Screw terminal connector + +4-pin + +GN + + + +1 + +W + +2 + +X + +3 + +Y + +4 + +Z - - -W3:e--AUTOGENERATED_F_2:w - - - + + +AUTOGENERATED_F_1:e--X4:w + + - - -W3:e--AUTOGENERATED_F_3:w - - - + + +AUTOGENERATED_F_2:e--X4:w + + - - -W3:e--AUTOGENERATED_F_4:w - - - + + +AUTOGENERATED_F_3:e--X4:w + + - - -AUTOGENERATED_WIRE_1:e--X2:w - - - + + +AUTOGENERATED_F_4:e--X4:w + + diff --git a/examples/ex14.tsv b/examples/ex14.tsv new file mode 100644 index 000000000..fe077f4c5 --- /dev/null +++ b/examples/ex14.tsv @@ -0,0 +1,8 @@ +# Qty Unit Description Designators +1 4 Connector, Ferrule, GY +2 1 Connector, JST SM, female, 4 pins X2 +3 2 Connector, JST SM, male, 4 pins X1, X3 +4 1 Connector, Screw terminal connector, 4 pins, GN X4 +5 8 Connector, Splice, CU S1 +6 1 m Cable, 1 wires +7 4 m Cable, 4 wires W1, W2, W21, W3 diff --git a/examples/ex14_wv_gvpr.gvpr b/examples/ex14_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex14_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex15.gv b/examples/ex15.gv new file mode 100644 index 000000000..f0b542ef3 --- /dev/null +++ b/examples/ex15.gv @@ -0,0 +1,375 @@ +graph { +// Graph generated by WireViz 0.4-dev251 +// https://github.com/formatc1702/WireViz + graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] + node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] + edge [fontname=arial style=bold] + X1 [label=< + + + + + + + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex KK 254female7-pin
+
+ + + + + + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + +
SH1SH2
GND1
VCC2
RX3
TX4
GND5
VCC6
GND7
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
42mmshortPartA
WireViz: 42XCD42A5
1xshortPartB
WireViz: 42XCD42A5
+
+> shape=box style=filled] + edge [color="#000000"] + X1:p1j:c -- X1:p5j:c [addPTS=.18 color="#FF66CC" colorPTS="#FF66CC" headclip=false straight=straight tailclip=false] + X1:p5j:c -- X1:p7j:c [addPTS=.18 color="#FF66CC" colorPTS="#FF66CC" headclip=false straight=straight tailclip=false] + X1:p2j:c -- X1:p6j:c [addPTS=.18 color="#FF0000" colorPTS="#FF0000" headclip=false straight=straight tailclip=false] + X2 [label=< + + + + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female7-pin
+
+ + + + + + + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + +
SH1SH2
1GND
2VCC
3RX
4TX
5GND
6VCC
7GND
+
+> shape=box style=filled] + edge [color="#000000"] + X2:p1j:c -- X2:p5j:c [addPTS=.18 color="#000000" colorPTS="#000000" headclip=false straight=straight tailclip=false] + X2:p5j:c -- X2:p7j:c [addPTS=.18 color="#000000" colorPTS="#000000" headclip=false straight=straight tailclip=false] + X2:p2j:c -- X2:p6j:c [addPTS=.18 color="#000000" colorPTS="#000000" headclip=false straight=straight tailclip=false] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + + + +
Serial4x0.25 mm² (24 AWG)+ S0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND 1:BUWH X2:1:GND
+ + + + + + + + + + + + + + + + +
+
X1:2:VCC 2:WHBU X2:2:VCC
+ + + + + + + + + + + + + + + + +
+
X1:3:RX 3:OGWH X2:4:TX
+ + + + + + + + + + + + + + + + +
+
X1:4:TX 4:WHOG X2:3:RX
+ + + + + + + + + + + + + + + + +
+
 
X1:1:GND Shield
+ + + + +
+
 
+
+> shape=box style=filled] + edge [color="#000000:#0066FF:#FFFFFF:#0066FF:#000000"] + X1:p1r:e -- W1:w1:w + W1:w1:e -- X2:p1l:w + edge [color="#000000:#FFFFFF:#0066FF:#FFFFFF:#000000"] + X1:p2r:e -- W1:w2:w + W1:w2:e -- X2:p2l:w + edge [color="#000000:#FF8000:#FFFFFF:#FF8000:#000000"] + X1:p3r:e -- W1:w3:w + W1:w3:e -- X2:p4l:w + edge [color="#000000:#FFFFFF:#FF8000:#FFFFFF:#000000"] + X1:p4r:e -- W1:w4:w + W1:w4:e -- X2:p3l:w + edge [color="#000000"] + X1:p1r:e -- W1:w5:w + W1:w1:e -- W1:w1:w [color="#000000:#0066FF:#FFFFFF:#0066FF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FFFFFF:#0066FF:#FFFFFF:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FF8000:#FFFFFF:#FF8000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFFFF:#FF8000:#FFFFFF:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000" straight=straight] +} diff --git a/examples/ex15.html b/examples/ex15.html new file mode 100644 index 000000000..acd1525ef --- /dev/null +++ b/examples/ex15.html @@ -0,0 +1,510 @@ + + + + + ex15 + + +

ex15

+

Diagram

+ +
+ +
+ +
+ + + + + + + + +X1 + + + +X1 + +Molex KK 254 + +female + +7-pin + + +SH1 + +SH2 + + +GND + + + +1 + +VCC + + + +2 + +RX + + + +3 + +TX + + + +4 + +GND + + + +5 + +VCC + + + +6 + +GND + + + +7 +42 +mm +shortPartA +WireViz: 42XCD42A5 +1 +x +shortPartB +WireViz: 42XCD42A5 + + + + +X1:c--X1:c + + + + +X1:c--X1:c + + + + +X1:c--X1:c + + + + +W1 + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BUWH + +X2:1:GND + + + + + + X1:2:VCC + +2:WHBU + +X2:2:VCC + + + + + + X1:3:RX + +3:OGWH + +X2:4:TX + + + + + + X1:4:TX + +4:WHOG + +X2:3:RX + + + + + +  + X1:1:GND + +Shield + + + +  + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + +X2 + + + +X2 + +Molex KK 254 + +female + +7-pin + + + +SH1 + +SH2 + +1 + +GND + + + +2 + +VCC + + + +3 + +RX + + + +4 + +TX + + + +5 + +GND + + + +6 + +VCC + + + +7 + +GND + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +X2:c--X2:c + + + + +X2:c--X2:c + + + + +X2:c--X2:c + + + + +__CIRCLE__1 + + + + +__CIRCLE__2 + + + + +__CIRCLE__3 + + + + +__CIRCLE__4 + + + + +__CIRCLE__5 + + + + +__CIRCLE__6 + + + + +__CIRCLE__7 + + + + +__CIRCLE__8 + + + + +__CIRCLE__9 + + + + +__CIRCLE__10 + + + + +__CIRCLE__11 + + + + +__CIRCLE__12 + + + + + +
+ +
+ +
+ +

Bill of Materials

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#QtyUnitDescriptionDesignatorsManufacturerMPN
12Connector, Molex KK 254, female, 7 pinsX1, X2
21mCable, Serial, 4 x 0.25 mm² shieldedW1
342mmshortPartAX1WireViz42XCD42A5
41shortPartBX1WireViz42XCD42A5
+ +
+ + diff --git a/examples/ex15.png b/examples/ex15.png new file mode 100644 index 000000000..89562b1b3 Binary files /dev/null and b/examples/ex15.png differ diff --git a/examples/ex15.svg b/examples/ex15.svg new file mode 100644 index 000000000..800b9bf7d --- /dev/null +++ b/examples/ex15.svg @@ -0,0 +1,420 @@ + + + + + + + + + +X1 + + + +X1 + +Molex KK 254 + +female + +7-pin + + +SH1 + +SH2 + + +GND + + + +1 + +VCC + + + +2 + +RX + + + +3 + +TX + + + +4 + +GND + + + +5 + +VCC + + + +6 + +GND + + + +7 +42 +mm +shortPartA +WireViz: 42XCD42A5 +1 +x +shortPartB +WireViz: 42XCD42A5 + + + + +X1:c--X1:c + + + + +X1:c--X1:c + + + + +X1:c--X1:c + + + + +W1 + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BUWH + +X2:1:GND + + + + + + X1:2:VCC + +2:WHBU + +X2:2:VCC + + + + + + X1:3:RX + +3:OGWH + +X2:4:TX + + + + + + X1:4:TX + +4:WHOG + +X2:3:RX + + + + + +  + X1:1:GND + +Shield + + + +  + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + +X2 + + + +X2 + +Molex KK 254 + +female + +7-pin + + + +SH1 + +SH2 + +1 + +GND + + + +2 + +VCC + + + +3 + +RX + + + +4 + +TX + + + +5 + +GND + + + +6 + +VCC + + + +7 + +GND + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +X2:c--X2:c + + + + +X2:c--X2:c + + + + +X2:c--X2:c + + + + +__CIRCLE__1 + + + + +__CIRCLE__2 + + + + +__CIRCLE__3 + + + + +__CIRCLE__4 + + + + +__CIRCLE__5 + + + + +__CIRCLE__6 + + + + +__CIRCLE__7 + + + + +__CIRCLE__8 + + + + +__CIRCLE__9 + + + + +__CIRCLE__10 + + + + +__CIRCLE__11 + + + + +__CIRCLE__12 + + + + diff --git a/examples/ex15.tsv b/examples/ex15.tsv new file mode 100644 index 000000000..53017cb43 --- /dev/null +++ b/examples/ex15.tsv @@ -0,0 +1,5 @@ +# Qty Unit Description Designators Manufacturer MPN +1 2 Connector, Molex KK 254, female, 7 pins X1, X2 +2 1 m Cable, Serial, 4 x 0.25 mm² shielded W1 +3 42 mm shortPartA X1 WireViz 42XCD42A5 +4 1 shortPartB X1 WireViz 42XCD42A5 diff --git a/examples/ex15.yml b/examples/ex15.yml new file mode 100644 index 000000000..0e90e2eb7 --- /dev/null +++ b/examples/ex15.yml @@ -0,0 +1,46 @@ +connectors: # This is based on ex1 and adds some Shorts to the connectors + X1: # An example of Shorts with more information + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + shorts: # A List(Dict) of shorts is created + SH1: [1, 5, 7] # First is the designator than a list of pins to be shorted + SH2: [2, 6] + additional_components: # Some Additional Components to describe the short in more detail + - references: SH1 + color: PK # The color of the short, can also be multicolor + manufacturer: WireViz + mpn: 42XCD42A5 + type: shortPartA + amount: 42 mm # The length or some other quantity + - references: SH2 + color: RD + manufacturer: WireViz + mpn: 42XCD42A5 + type: shortPartB + X2: # An example of a simple short definition + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + shorts: # The definition is the same as above but there is no additional_components for more information + SH1: [1, 5, 7] + SH2: [2, 6] + +cables: + W1: + color_code: TEL + wirecount: 4 + gauge: 0.25 mm2 + show_equiv: true + length: 0.2 + shield: true + type: Serial + +connections: + - + - X1: [1-4] + - W1: [1-4] + - X2: [1,2,4,3] + - + - X1: 1 + - W1: s \ No newline at end of file diff --git a/examples/ex15_wv_gvpr.gvpr b/examples/ex15_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex15_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/ex16.gv b/examples/ex16.gv new file mode 100644 index 000000000..e596b8e33 --- /dev/null +++ b/examples/ex16.gv @@ -0,0 +1,357 @@ +graph { +// Graph generated by WireViz 0.4-dev251 +// https://github.com/formatc1702/WireViz + graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] + node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] + edge [fontname=arial style=bold] + X1 [label=< + + + + + + + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex KK 254female7-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
GND1
VCC2
RX3
TX4
GND5
VCC6
GND7
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
42mmloopPartA
WireViz: 42XCD42A5
74mmloopPartB
WireViz: 42XCD42A5
+
+> shape=box style=filled] + edge [color="#000000"] + X1:p1r:e -- X1:p5r:e [label=" " color="#FF66CC" noLabel=noLabel] + X1:p5r:e -- X1:p7r:e [label=" " color="#FF66CC" noLabel=noLabel] + X1:p2r:e -- X1:p6r:e [label=" " color="#FF0000:#0066FF:#FF8000:#A0DFFF" noLabel=noLabel] + X2 [label=< + + + + + + + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female7-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2VCC
3RX
4TX
5GND
6VCC
7GND
+
+ + + + + + + + + + + + + +
21mmloopPartC
WireViz: 42XCD42A5
+
+> shape=box style=filled] + edge [color="#000000"] + X2:p1l:w -- X2:p5l:w [label=" " color="#FF66CC" noLabel=noLabel] + X2:p5l:w -- X2:p7l:w [label=" " color="#FF66CC" noLabel=noLabel] + X2:p2l:w -- X2:p6l:w [label=" " color="#FF66CC" noLabel=noLabel] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + + + +
Serial4x0.25 mm² (24 AWG)+ S0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND 1:BN X2:1:GND
+ + + + + + + + + + +
+
X1:2:VCC 2:RD X2:2:VCC
+ + + + + + + + + + +
+
X1:3:RX 3:OG X2:4:TX
+ + + + + + + + + + +
+
X1:4:TX 4:YE X2:3:RX
+ + + + + + + + + + +
+
 
X1:1:GND Shield
+ + + + +
+
 
+
+> shape=box style=filled] + edge [color="#000000:#895956:#000000"] + X1:p1r:e -- W1:w1:w + W1:w1:e -- X2:p1l:w + edge [color="#000000:#FF0000:#000000"] + X1:p2r:e -- W1:w2:w + W1:w2:e -- X2:p2l:w + edge [color="#000000:#FF8000:#000000"] + X1:p3r:e -- W1:w3:w + W1:w3:e -- X2:p4l:w + edge [color="#000000:#FFFF00:#000000"] + X1:p4r:e -- W1:w4:w + W1:w4:e -- X2:p3l:w + edge [color="#000000"] + X1:p1r:e -- W1:w5:w + W1:w1:e -- W1:w1:w [color="#000000:#895956:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000" straight=straight] +} diff --git a/examples/ex16.html b/examples/ex16.html new file mode 100644 index 000000000..dbba7371b --- /dev/null +++ b/examples/ex16.html @@ -0,0 +1,395 @@ + + + + + ex16 + + +

ex16

+

Diagram

+ +
+ +
+ +
+ + + + + + + + +X1 + + + +X1 + +Molex KK 254 + +female + +7-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 + +GND + +5 + +VCC + +6 + +GND + +7 +42 +mm +loopPartA +WireViz: 42XCD42A5 +74 +mm +loopPartB +WireViz: 42XCD42A5 + + + + +X1:e--X1:e + + + + +X1:e--X1:e + + + + +X1:e--X1:e + + + + + + + +W1 + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BN + +X2:1:GND + + + + X1:2:VCC + +2:RD + +X2:2:VCC + + + + X1:3:RX + +3:OG + +X2:4:TX + + + + X1:4:TX + +4:YE + +X2:3:RX + + + +  + X1:1:GND + +Shield + + + +  + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + +X2 + + + +X2 + +Molex KK 254 + +female + +7-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX + +5 + +GND + +6 + +VCC + +7 + +GND +21 +mm +loopPartC +WireViz: 42XCD42A5 + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +X2:w--X2:w + + + + +X2:w--X2:w + + + + +X2:w--X2:w + + + + + +
+ +
+ +
+ +

Bill of Materials

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#QtyUnitDescriptionDesignatorsManufacturerMPN
12Connector, Molex KK 254, female, 7 pinsX1, X2
21mCable, Serial, 4 x 0.25 mm² shieldedW1
342mmloopPartAX1WireViz42XCD42A5
474mmloopPartBX1WireViz42XCD42A5
521mmloopPartCX2WireViz42XCD42A5
+ +
+ + diff --git a/examples/ex16.png b/examples/ex16.png new file mode 100644 index 000000000..aa92e169d Binary files /dev/null and b/examples/ex16.png differ diff --git a/examples/ex16.svg b/examples/ex16.svg new file mode 100644 index 000000000..afe273c38 --- /dev/null +++ b/examples/ex16.svg @@ -0,0 +1,296 @@ + + + + + + + + + +X1 + + + +X1 + +Molex KK 254 + +female + +7-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 + +GND + +5 + +VCC + +6 + +GND + +7 +42 +mm +loopPartA +WireViz: 42XCD42A5 +74 +mm +loopPartB +WireViz: 42XCD42A5 + + + + +X1:e--X1:e + + + + +X1:e--X1:e + + + + +X1:e--X1:e + + + + + + + +W1 + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BN + +X2:1:GND + + + + X1:2:VCC + +2:RD + +X2:2:VCC + + + + X1:3:RX + +3:OG + +X2:4:TX + + + + X1:4:TX + +4:YE + +X2:3:RX + + + +  + X1:1:GND + +Shield + + + +  + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + +X2 + + + +X2 + +Molex KK 254 + +female + +7-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX + +5 + +GND + +6 + +VCC + +7 + +GND +21 +mm +loopPartC +WireViz: 42XCD42A5 + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +X2:w--X2:w + + + + +X2:w--X2:w + + + + +X2:w--X2:w + + + + diff --git a/examples/ex16.tsv b/examples/ex16.tsv new file mode 100644 index 000000000..54f73d05a --- /dev/null +++ b/examples/ex16.tsv @@ -0,0 +1,6 @@ +# Qty Unit Description Designators Manufacturer MPN +1 2 Connector, Molex KK 254, female, 7 pins X1, X2 +2 1 m Cable, Serial, 4 x 0.25 mm² shielded W1 +3 42 mm loopPartA X1 WireViz 42XCD42A5 +4 74 mm loopPartB X1 WireViz 42XCD42A5 +5 21 mm loopPartC X2 WireViz 42XCD42A5 diff --git a/examples/ex16.yml b/examples/ex16.yml new file mode 100644 index 000000000..c438d12b6 --- /dev/null +++ b/examples/ex16.yml @@ -0,0 +1,58 @@ +options: + mini_bom_mode: false # disable mini_bom to show difference to ex15 + +connectors: # This is based on ex1 and adds some Loops to the connectors + X1: + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + loops: # A List(Dict) of loops is created + LO1: [1, 5, 7] # First is the designator than a list of pins to be shorted + LO2: [2, 6] + additional_components: # Some Additional Components to describe the short in more detail + - references: LO1 + color: PK # The color of the short, can also be multicolor + manufacturer: WireViz + mpn: 42XCD42A5 + type: loopPartA + amount: 42 mm # The length or some other quantity + - references: LO2 + color: RDBUOGLB # multicolor example + manufacturer: WireViz + mpn: 42XCD42A5 + type: loopPartB + amount: 74 mm + + X2: + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + loops: + LO1: [1, 5, 7] + LO2: [2, 6] + additional_components: + - references: [LO1, LO2] # example to show how one additional_components can reference more than one short or loop + color: PK + manufacturer: WireViz + mpn: 42XCD42A5 + type: loopPartC + amount: 21 mm + +cables: + W1: + color_code: IEC + wirecount: 4 + gauge: 0.25 mm2 + show_equiv: true + length: 0.2 + shield: true + type: Serial + +connections: + - + - X1: [1-4] + - W1: [1-4] + - X2: [1,2,4,3] + - + - X1: 1 + - W1: s diff --git a/examples/ex16_wv_gvpr.gvpr b/examples/ex16_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/examples/ex16_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/examples/readme.md b/examples/readme.md index 88a4389ca..739eac65b 100644 --- a/examples/readme.md +++ b/examples/readme.md @@ -3,84 +3,96 @@ ## Example 01 ![](ex01.png) -[Source](ex01.yml) - [Bill of Materials](ex01.bom.tsv) +[Source](ex01.yml) - [Bill of Materials](ex01.tsv) ## Example 02 ![](ex02.png) -[Source](ex02.yml) - [Bill of Materials](ex02.bom.tsv) +[Source](ex02.yml) - [Bill of Materials](ex02.tsv) ## Example 03 ![](ex03.png) -[Source](ex03.yml) - [Bill of Materials](ex03.bom.tsv) +[Source](ex03.yml) - [Bill of Materials](ex03.tsv) ## Example 04 ![](ex04.png) -[Source](ex04.yml) - [Bill of Materials](ex04.bom.tsv) +[Source](ex04.yml) - [Bill of Materials](ex04.tsv) ## Example 05 ![](ex05.png) -[Source](ex05.yml) - [Bill of Materials](ex05.bom.tsv) +[Source](ex05.yml) - [Bill of Materials](ex05.tsv) ## Example 06 ![](ex06.png) -[Source](ex06.yml) - [Bill of Materials](ex06.bom.tsv) +[Source](ex06.yml) - [Bill of Materials](ex06.tsv) ## Example 07 ![](ex07.png) -[Source](ex07.yml) - [Bill of Materials](ex07.bom.tsv) +[Source](ex07.yml) - [Bill of Materials](ex07.tsv) ## Example 08 ![](ex08.png) -[Source](ex08.yml) - [Bill of Materials](ex08.bom.tsv) +[Source](ex08.yml) - [Bill of Materials](ex08.tsv) ## Example 09 ![](ex09.png) -[Source](ex09.yml) - [Bill of Materials](ex09.bom.tsv) +[Source](ex09.yml) - [Bill of Materials](ex09.tsv) ## Example 10 ![](ex10.png) -[Source](ex10.yml) - [Bill of Materials](ex10.bom.tsv) +[Source](ex10.yml) - [Bill of Materials](ex10.tsv) ## Example 11 ![](ex11.png) -[Source](ex11.yml) - [Bill of Materials](ex11.bom.tsv) +[Source](ex11.yml) - [Bill of Materials](ex11.tsv) ## Example 12 ![](ex12.png) -[Source](ex12.yml) - [Bill of Materials](ex12.bom.tsv) +[Source](ex12.yml) - [Bill of Materials](ex12.tsv) ## Example 13 ![](ex13.png) -[Source](ex13.yml) - [Bill of Materials](ex13.bom.tsv) +[Source](ex13.yml) - [Bill of Materials](ex13.tsv) ## Example 14 ![](ex14.png) -[Source](ex14.yml) - [Bill of Materials](ex14.bom.tsv) +[Source](ex14.yml) - [Bill of Materials](ex14.tsv) + + +## Example 15 +![](ex15.png) + +[Source](ex15.yml) - [Bill of Materials](ex15.tsv) + + +## Example 16 +![](ex16.png) + +[Source](ex16.yml) - [Bill of Materials](ex16.tsv) diff --git a/src/wireviz/wv_dataclasses.py b/src/wireviz/wv_dataclasses.py index ded141a56..6afdbbc5c 100644 --- a/src/wireviz/wv_dataclasses.py +++ b/src/wireviz/wv_dataclasses.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from collections import namedtuple -from dataclasses import dataclass, field +from dataclasses import dataclass, field, asdict from enum import Enum from itertools import zip_longest from typing import Any, Dict, List, Optional, Tuple, Union @@ -263,9 +263,13 @@ class AdditionalComponent(GraphicalComponent): explicit_qty: bool = True amount_computed: Optional[NumberAndUnit] = None note: str = None + color: Optional[MultiColor] = None + references: Optional[List[str]] = field(default_factory=list) def __post_init__(self): super().__post_init__() + + self.color = MultiColor(self.color) if isinstance(self.qty_multiplier, float) or isinstance( self.qty_multiplier, int @@ -307,7 +311,9 @@ class TopLevelGraphicalComponent(GraphicalComponent): # abstract class class Connector(TopLevelGraphicalComponent): # connector-specific properties style: Optional[str] = None - loops: List[List[Pin]] = field(default_factory=list) + # TODO: Move shorts and loops to PinClass + loops: Dict[str, List[int]] = field(default_factory=dict) + shorts: Dict[str, List[int]] = field(default_factory=dict) # pin information in particular pincount: Optional[int] = None pins: List[Pin] = field(default_factory=list) # legacy @@ -412,20 +418,41 @@ def __post_init__(self) -> None: # hide pincount for simple (1 pin) connectors by default self.show_pincount = self.style != "simple" - for loop in self.loops: - # TODO: allow using pin labels in addition to pin numbers, - # just like when defining regular connections - # TODO: include properties of wire used to create the loop - if len(loop) != 2: - raise Exception("Loops must be between exactly two pins!") - for pin in loop: + # TODO: allow using pin labels in addition to pin numbers, + # just like when defining regular connections + # TODO: include properties of wire used to create the loop + for loopName in self.loops: + for pin in self.loops[loopName]: + if pin not in self.pins: + raise Exception( + f'Unknown loop pin "{pin}" for connector "{self.designator}"!' + ) + # Make sure loop connected pins are not hidden. + self.activate_pin(pin, None) + for short in self.shorts: + for pin in self.shorts[short]: if pin not in self.pins: raise Exception( - f'Unknown loop pin "{pin}" for connector "{self.name}"!' + f'Unknown loop pin "{pin}" for connector "{self.designator}"!' ) # Make sure loop connected pins are not hidden. - # side=None, determine side to show loops during rendering - self.activate_pin(pin, side=None, is_connection=True) + self.activate_pin(pin, None) + + # TODO: Remove the outcommented code here if it is no longer needed as reference + # for loop in self.loops: + # # TODO: allow using pin labels in addition to pin numbers, + # # just like when defining regular connections + # # TODO: include properties of wire used to create the loop + # if len(loop) != 2: + # raise Exception("Loops must be between exactly two pins!") + # for pin in loop: + # if pin not in self.pins: + # raise Exception( + # f'Unknown loop pin "{pin}" for connector "{self.name}"!' + # ) + # # Make sure loop connected pins are not hidden. + # # side=None, determine side to show loops during rendering + # self.activate_pin(pin, side=None, is_connection=True) for i, item in enumerate(self.additional_components): if isinstance(item, dict): diff --git a/src/wireviz/wv_graphviz.py b/src/wireviz/wv_graphviz.py index d42dcacca..680fcf7e5 100644 --- a/src/wireviz/wv_graphviz.py +++ b/src/wireviz/wv_graphviz.py @@ -22,7 +22,7 @@ WireClass, ) from wireviz.wv_html import Img, Table, Td, Tr -from wireviz.wv_utils import html_line_breaks, remove_links +from wireviz.wv_utils import html_line_breaks, remove_links, getAddCompFromRef def gv_node_component(component: Component) -> Table: @@ -260,8 +260,26 @@ def nested_table_dict(d: dict) -> Table: return Table(rows, border=0, cellborder=1, cellpadding=3, cellspacing=0) +def gv_shorts_info_row(component) -> Tr: + shorts_info = [] + if component.ports_left: + shorts_info.append(Td(f'')) + if component.pinlabels: + shorts_info.append(Td(f'')) + + for short in component.shorts: + shorts_info.append(Td(f'{short}')) + + if component.ports_right: + shorts_info.append(Td(f'')) + return Tr(shorts_info) + def gv_pin_table(component) -> Table: pin_rows = [] + + if len(component.shorts) > 0: + pin_rows.append(gv_shorts_info_row(component)) + for pin in component.pin_objects.values(): if component.should_show_pin(pin.id): pin_rows.append(gv_pin_row(pin, component)) @@ -272,6 +290,16 @@ def gv_pin_table(component) -> Table: return tbl +def gv_short_row_part(pin, connector) -> List: + short_row = []# Td("ADA"), Td("DAD") + for short, shPins in connector.shorts.items(): + if pin.index+1 in shPins: + short_row.append(Td("", port=f"p{pin.index+1}j")) + else: + short_row.append(Td("")) + return short_row + + def gv_pin_row(pin, connector) -> Tr: # ports in GraphViz are 1-indexed for more natural maping to pin/wire numbers has_pincolors = any([_pin.color for _pin in connector.pin_objects.values()]) @@ -280,6 +308,7 @@ def gv_pin_row(pin, connector) -> Tr: Td(pin.label, delete_if_empty=True), Td(str(pin.color) if pin.color else "", sides="TBL") if has_pincolors else None, Td(color_minitable(pin.color), sides="TBR") if has_pincolors else None, + gv_short_row_part(pin, connector), Td(pin.id, port=f"p{pin.index+1}r") if connector.ports_right else None, ] return Tr(cells) @@ -295,13 +324,37 @@ def gv_connector_loops(connector: Connector) -> List: loop_dir = "e" else: raise Exception("No side for loops") - for loop in connector.loops: - head = f"{connector.designator}:p{loop[0]}{loop_side}:{loop_dir}" - tail = f"{connector.designator}:p{loop[1]}{loop_side}:{loop_dir}" - loop_edges.append((head, tail)) + + for loop, loPins in connector.loops.items(): + comp = getAddCompFromRef(loop, connector) + loColor = "#000000" + if comp != None and comp.color != None: + loColor = comp.color.html + + for i in range(1, len(loPins)): + head = f"{connector.designator}:p{loPins[i - 1]}{loop_side}:{loop_dir}" + tail = f"{connector.designator}:p{loPins[i]}{loop_side}:{loop_dir}" + loop_edges.append((head, tail, loColor)) return loop_edges +def gv_connector_shorts(connector: Connector) -> List: + short_edges = [] + + for short, shPins in connector.shorts.items(): + comp = getAddCompFromRef(short, connector) + shColor = "#000000" + if comp != None and comp.color != None: + shColor = comp.color.html + + for i in range(1, len(shPins)): + head = f"{connector.designator}:p{shPins[i - 1]}j:c" + tail = f"{connector.designator}:p{shPins[i]}j:c" + short_edges.append((head, tail, shColor)) + return short_edges + + + def gv_conductor_table(cable) -> Table: rows = [] rows.append(Tr(Td(" "))) # spacer row on top @@ -372,7 +425,7 @@ def gv_wire_cell(wire: Union[WireClass, ShieldClass], colspan: int) -> Td: wire_inner_rows = [] for j, bgcolor in enumerate(color_list[::-1]): wire_inner_cell_attribs = { - "bgcolor": bgcolor if bgcolor != "" else "#000000", + "bgcolor": "#FFFFFF", # bgcolor if bgcolor != "" else "#000000", # TODO: More elegent solution for making black/whit space needed, since the wire is drawn as an actual edge "border": 0, "cellpadding": 0, "colspan": colspan, @@ -393,8 +446,10 @@ def gv_wire_cell(wire: Union[WireClass, ShieldClass], colspan: int) -> Td: return wire_outer_cell + dot.attr("edge", headclip="true", tailclip="true", style="bold") -def gv_edge_wire(harness, cable, connection) -> Tuple[str, str, str, str, str]: + # color, l1, l2, r1, r2 +def gv_edge_wire(harness, cable, connection) -> Tuple[str, str, str, str, str]: if connection.via.color: # check if it's an actual wire and not a shield color = f"#000000:{connection.via.color.html_padded}:#000000" @@ -426,6 +481,24 @@ def gv_edge_wire(harness, cable, connection) -> Tuple[str, str, str, str, str]: return color, code_left_1, code_left_2, code_right_1, code_right_2 + # color, we, ww, +def gv_edge_wire_inside(cable) -> List[Tuple[str, str, str]]: + wires = [] + # print(cable.wire_objects) + for wire in cable.wire_objects.values(): + color = "#000000" + if wire.color: + # check if it's an actual wire and not a shield + color = f"#000000:{wire.color.html_padded}:#000000" + else: # it's a shield connection + color = "#000000" + + we = f"{wire.parent}:w{wire.index+1}:e" + ww = f"{wire.parent}:w{wire.index+1}:w" + + wires.append([color, we, ww]) + return wires + def parse_arrow_str(inp: str) -> ArrowDirection: if inp[0] == "<" and inp[-1] == ">": diff --git a/src/wireviz/wv_gvpr.gvpr b/src/wireviz/wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/src/wireviz/wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/src/wireviz/wv_harness.py b/src/wireviz/wv_harness.py index 0c730acb4..8531df8ef 100644 --- a/src/wireviz/wv_harness.py +++ b/src/wireviz/wv_harness.py @@ -1,9 +1,12 @@ # -*- coding: utf-8 -*- +import os +import shutil from collections import defaultdict -from dataclasses import dataclass, field +from dataclasses import dataclass, field, asdict from pathlib import Path from typing import List, Union +from distutils.spawn import find_executable from graphviz import Graph @@ -24,13 +27,16 @@ Side, TopLevelGraphicalComponent, Tweak, + Image, ) from wireviz.wv_graphviz import ( apply_dot_tweaks, calculate_node_bgcolor, gv_connector_loops, + gv_connector_shorts, gv_edge_mate, gv_edge_wire, + gv_edge_wire_inside, gv_node_component, parse_arrow_str, set_dot_basics, @@ -40,7 +46,7 @@ embed_svg_images_file, generate_html_output, ) -from wireviz.wv_utils import bom2tsv, open_file_write +from wireviz.wv_utils import bom2tsv, open_file_write, getAddCompFromRef @dataclass @@ -321,8 +327,20 @@ def create_graph(self) -> Graph: if len(connector.loops) > 0: dot.attr("edge", color="#000000") loops = gv_connector_loops(connector) - for head, tail in loops: - dot.edge(head, tail) + for head, tail, color in loops: + dot.edge(head, tail, color = color, label = " ", noLabel="noLabel") + + # generate edges for connector shorts + if len(connector.shorts) > 0: + dot.attr("edge", color="#000000") + shorts = gv_connector_shorts(connector) + for head, tail, color in shorts: + dot.edge(head, tail, + color=color, + straight="straight", + addPTS=".18", # Size of the point at the end of the straight line/edge, it also enables the drawing of it + colorPTS=color, + headclip="false", tailclip="false") # determine if there are double- or triple-colored wires in the harness; # if so, pad single-color wires to make all wires of equal thickness @@ -357,6 +375,10 @@ def create_graph(self) -> Graph: dot.edge(l1, l2) if not (r1, r2) == (None, None): dot.edge(r1, r2) + + for color, we, ww in gv_edge_wire_inside(cable): + if not (we, ww) == (None, None): + dot.edge(we, ww, color=color, straight="straight") for mate in self.mates: color, dir, code_from, code_to = gv_edge_mate(mate) @@ -392,6 +414,21 @@ def png(self): def svg(self): graph = self.graph return embed_svg_images(graph.pipe(format="svg").decode("utf-8"), Path.cwd()) + + def graphRender(self, type, filename, graph): + # Chack if the needed commands are existing + if find_executable("dot") and find_executable("gvpr") and find_executable("neato"): + # Set enviorments variable to path of this file + os.environ['GVPRPATH'] = str(Path(__file__).parent) + # Export the gv output to a temporay file + graph.save(filename=f"{filename}_tmp.gv") + # Run the vomand and generait the output + os.system(f"dot {filename}_tmp.gv | gvpr -q -cf wv_gvpr.gvpr | neato -n2 -T{type} -o {filename}.{type}") + # Remove the temporary file + os.remove(f"{filename}_tmp.gv") + else: + print('The "dot", "gvpr" and "neato" comand where not found on the system, use old methode of generaiton, this may lead to not wanted output.') + graph.render(filename=filename) # old rendering methode, befor jumper implementations def output( self, @@ -410,13 +447,17 @@ def output( _filename = f"{filename}.tmp" if f == "svg" else filename # TODO: prevent rendering SVG twice when both SVG and HTML are specified graph.format = f - graph.render(filename=_filename, view=view, cleanup=cleanup) + self.graphRender(f, _filename, graph) # embed images into SVG output if "svg" in fmt or "html" in fmt: embed_svg_images_file(f"{filename}.tmp.svg") # GraphViz output if "gv" in fmt: graph.save(filename=f"{filename}.gv") + # Print the needed comand for generaitong an output + filename_str = str(filename) + shutil.copyfile(str(Path(__file__).parent).replace('\\', '/') + "/wv_gvpr.gvpr", filename_str + "_wv_gvpr.gvpr") + print(f"Use: dot {filename_str}.gv | gvpr -q -cf {filename_str}_wv_gvpr.gvpr | neato -n2 -T -o {filename_str}.") # BOM output bomlist = bom_list(self.bom) # bomlist = [[]] diff --git a/src/wireviz/wv_utils.py b/src/wireviz/wv_utils.py index fb04e88db..81e9b4165 100644 --- a/src/wireviz/wv_utils.py +++ b/src/wireviz/wv_utils.py @@ -214,3 +214,10 @@ def smart_file_resolve(filename: str, possible_paths: Union[str, List[str]]) -> f"{filename} was not found in any of the following locations: \n" + "\n".join([str(x) for x in possible_paths]) ) + +# Returns a Additional Component from with the given +def getAddCompFromRef(reference, part): + #print(part.additional_components) + for comp in part.additional_components: + if reference in comp.references: + return comp; diff --git a/tests/bom/bomqty_wv_gvpr.gvpr b/tests/bom/bomqty_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tests/bom/bomqty_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tests/rendering/00_minimal_wv_gvpr.gvpr b/tests/rendering/00_minimal_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tests/rendering/00_minimal_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tests/rendering/01_color_single_wv_gvpr.gvpr b/tests/rendering/01_color_single_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tests/rendering/01_color_single_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tests/rendering/02_color_multi_wv_gvpr.gvpr b/tests/rendering/02_color_multi_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tests/rendering/02_color_multi_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tests/rendering/03_bgcolors_wv_gvpr.gvpr b/tests/rendering/03_bgcolors_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tests/rendering/03_bgcolors_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tutorial/readme.md b/tutorial/readme.md index 56f9cce57..a810c721f 100644 --- a/tutorial/readme.md +++ b/tutorial/readme.md @@ -27,7 +27,7 @@ connections: ![](tutorial01.png) -[Source](tutorial01.yml) - [Bill of Materials](tutorial01.bom.tsv) +[Source](tutorial01.yml) - [Bill of Materials](tutorial01.tsv) ## 02 - Adding parameters and colors @@ -68,7 +68,7 @@ connections: ![](tutorial02.png) -[Source](tutorial02.yml) - [Bill of Materials](tutorial02.bom.tsv) +[Source](tutorial02.yml) - [Bill of Materials](tutorial02.tsv) ## 03 - Pinouts, shielding, templates (I) @@ -110,7 +110,7 @@ connections: ![](tutorial03.png) -[Source](tutorial03.yml) - [Bill of Materials](tutorial03.bom.tsv) +[Source](tutorial03.yml) - [Bill of Materials](tutorial03.tsv) ## 04 - Templates (II), notes, American standards, daisy chaining (I) @@ -163,7 +163,7 @@ connections: ![](tutorial04.png) -[Source](tutorial04.yml) - [Bill of Materials](tutorial04.bom.tsv) +[Source](tutorial04.yml) - [Bill of Materials](tutorial04.tsv) ## 05 - Ferrules, wire bundles, custom wire colors @@ -209,7 +209,7 @@ connections: ![](tutorial05.png) -[Source](tutorial05.yml) - [Bill of Materials](tutorial05.bom.tsv) +[Source](tutorial05.yml) - [Bill of Materials](tutorial05.tsv) ## 06 - Custom ferrules @@ -252,7 +252,7 @@ connections: ![](tutorial06.png) -[Source](tutorial06.yml) - [Bill of Materials](tutorial06.bom.tsv) +[Source](tutorial06.yml) - [Bill of Materials](tutorial06.tsv) ## 07 - Daisy chaining (II) @@ -318,7 +318,7 @@ connections: ![](tutorial07.png) -[Source](tutorial07.yml) - [Bill of Materials](tutorial07.bom.tsv) +[Source](tutorial07.yml) - [Bill of Materials](tutorial07.tsv) ## 08 - Part numbers and additional components @@ -345,12 +345,14 @@ connectors: spn: 1234 # add a list of additional components to a part (shown in graph) additional_components: - - type: Crimp # short identifier used in graph + - + type: Crimp # short identifier used in graph subtype: Molex KK 254, 22-30 AWG # extra information added to type in bom qty_multiplier: populated # multipier for quantity (number of populated pins) manufacturer: Molex # set manufacter name mpn: 08500030 # set manufacturer part number - - type: Test + - + type: Test qty: 1 pn: ABC manufacturer: Molex @@ -379,30 +381,33 @@ cables: length: 1 gauge: 0.25 mm2 colors: [YE, BK, BK, RD] - manufacturer: [WiresCo, WiresCo, WiresCo, WiresCo] # set a manufacter per wire - mpn: [W1-YE, W1-BK, W1-BK, W1-RD] - supplier: [WireShack, WireShack, WireShack, WireShack] - spn: [1001, 1002, 1002, 1009] - pn: [WIRE1, WIRE2, WIRE2, WIRE3] + manufacturer: [WiresCo,WiresCo,WiresCo,WiresCo] # set a manufacter per wire + mpn: [W1-YE,W1-BK,W1-BK,W1-RD] + supplier: [WireShack,WireShack,WireShack,WireShack] + spn: [1001,1002,1002,1009] + pn: [WIRE1,WIRE2,WIRE2,WIRE3] # add a list of additional components to a part (shown in graph) additional_components: - - type: Sleve # short identifier used in graph + - + type: Sleeve # short identifier used in graph subtype: Braided nylon, black, 3mm # extra information added to type in bom qty_multiplier: length # multipier for quantity (length of cable) - unit: m pn: SLV-1 + connections: - - - X1: [1-4] + - + - X1: [1-4] - W1: [1-4] - X2: [1-4] - - - X1: [1-4] + - + - X1: [1-4] - W2: [1-4] - X3: [1-4] additional_bom_items: - # define an additional item to add to the bill of materials (does not appear in graph) - description: Label, pinout information + type: Label, pinout information qty: 2 designators: - X2 @@ -414,6 +419,6 @@ additional_bom_items: ![](tutorial08.png) -[Source](tutorial08.yml) - [Bill of Materials](tutorial08.bom.tsv) +[Source](tutorial08.yml) - [Bill of Materials](tutorial08.tsv) diff --git a/tutorial/tutorial01.gv b/tutorial/tutorial01.gv index df4ec3de1..3e343001e 100644 --- a/tutorial/tutorial01.gv +++ b/tutorial/tutorial01.gv @@ -1,164 +1,218 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - -
4-pin
-
- - - - - - - - - - - - - -
1
2
3
4
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + +
4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
1
2
3
4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - -
4-pin
-
- - - - - - - - - - - - - -
1
2
3
4
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + +
4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1
2
3
4
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + +
4x1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1 1 X2:1
+ + + + +
+
X1:2 2 X2:2
+ + + + +
+
X1:3 3 X2:3
+ + + + +
+
X1:4 4 X2:4
+ + + + +
+
 
+
+> shape=box style=filled] + edge [color="#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w - edge [color="#000000:#ffffff:#000000"] + edge [color="#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w - edge [color="#000000:#ffffff:#000000"] + edge [color="#000000"] X1:p3r:e -- W1:w3:w W1:w3:e -- X2:p3l:w - edge [color="#000000:#ffffff:#000000"] + edge [color="#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w - W1 [label=< - - - - -
- - -
W1
-
- - - -
4x1 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1 - 1 - X2:1
- - - - -
-
X1:2 - 2 - X2:2
- - - - -
-
X1:3 - 3 - X2:3
- - - - -
-
X1:4 - 4 - X2:4
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] + W1:w1:e -- W1:w1:w [color="#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000" straight=straight] } diff --git a/tutorial/tutorial01.html b/tutorial/tutorial01.html index 16f19934c..daad3d2d1 100644 --- a/tutorial/tutorial01.html +++ b/tutorial/tutorial01.html @@ -1,7 +1,7 @@ - + tutorial01 - +

tutorial01

Diagram

@@ -30,139 +30,146 @@

Diagram

- - - - + + + X1 - - -X1 - -4-pin - -1 - -2 - -3 - -4 + + + +X1 + +4-pin + +1 + +2 + +3 + +4 - + W1 - - -W1 - -4x - -1 m -  -X1:1 -     1     -X2:1 - - - -X1:2 -     2     -X2:2 - - - -X1:3 -     3     -X2:3 - - - -X1:4 -     4     -X2:4 - - - -  + + + +W1 + +4x + +1 m +  + X1:1 + +1 + +X2:1 + + X1:2 + +2 + +X2:2 + + X1:3 + +3 + +X2:3 + + X1:4 + +4 + +X2:4 + +  X1:e--W1:w - - - + - + X1:e--W1:w - - - + - + X1:e--W1:w - - - + - + X1:e--W1:w - - - + + + + +W1:e--W1:w + + + + +W1:e--W1:w + + + + +W1:e--W1:w + + + + +W1:e--W1:w + - + X2 - - -X2 - -4-pin - -1 - -2 - -3 - -4 + + + +X2 + +4-pin + +1 + +2 + +3 + +4 - + W1:e--X2:w - - - + - + W1:e--X2:w - - - + - + W1:e--X2:w - - - + - + W1:e--X2:w - - - + @@ -178,26 +185,26 @@

Bill of Materials

- - + + - - - - - - - - - + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, 4 wires1mW1
2Connector, 4 pins1 2 Connector, 4 pins X1, X2
21mCable, 4 wiresW1
diff --git a/tutorial/tutorial01.png b/tutorial/tutorial01.png index b94a39028..87f88088e 100644 Binary files a/tutorial/tutorial01.png and b/tutorial/tutorial01.png differ diff --git a/tutorial/tutorial01.svg b/tutorial/tutorial01.svg index ca1330aa6..f08a006ea 100644 --- a/tutorial/tutorial01.svg +++ b/tutorial/tutorial01.svg @@ -1,139 +1,146 @@ - - - - + + + X1 - - -X1 - -4-pin - -1 - -2 - -3 - -4 + + + +X1 + +4-pin + +1 + +2 + +3 + +4 - + W1 - - -W1 - -4x - -1 m -  -X1:1 -     1     -X2:1 - - - -X1:2 -     2     -X2:2 - - - -X1:3 -     3     -X2:3 - - - -X1:4 -     4     -X2:4 - - - -  + + + +W1 + +4x + +1 m +  + X1:1 + +1 + +X2:1 + + X1:2 + +2 + +X2:2 + + X1:3 + +3 + +X2:3 + + X1:4 + +4 + +X2:4 + +  X1:e--W1:w - - - + - + X1:e--W1:w - - - + - + X1:e--W1:w - - - + - + X1:e--W1:w - - - + + + + +W1:e--W1:w + + + + +W1:e--W1:w + + + + +W1:e--W1:w + + + + +W1:e--W1:w + - + X2 - - -X2 - -4-pin - -1 - -2 - -3 - -4 + + + +X2 + +4-pin + +1 + +2 + +3 + +4 - + W1:e--X2:w - - - + - + W1:e--X2:w - - - + - + W1:e--X2:w - - - + - + W1:e--X2:w - - - + diff --git a/tutorial/tutorial01.tsv b/tutorial/tutorial01.tsv new file mode 100644 index 000000000..749027018 --- /dev/null +++ b/tutorial/tutorial01.tsv @@ -0,0 +1,3 @@ +# Qty Unit Description Designators +1 2 Connector, 4 pins X1, X2 +2 1 m Cable, 4 wires W1 diff --git a/tutorial/tutorial01_wv_gvpr.gvpr b/tutorial/tutorial01_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tutorial/tutorial01_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tutorial/tutorial02.gv b/tutorial/tutorial02.gv index 1ea5546f6..ef03673bc 100644 --- a/tutorial/tutorial02.gv +++ b/tutorial/tutorial02.gv @@ -1,169 +1,247 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - -
1
2
3
4
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
1
2
3
4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - -
1
2
3
4
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1
2
3
4
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
4x0.25 mm² (24 AWG)1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1 1:WH X2:1
+ + + + + + + + + + +
+
X1:2 2:BN X2:2
+ + + + + + + + + + +
+
X1:3 3:GN X2:4
+ + + + + + + + + + +
+
X1:4 4:YE X2:3
+ + + + + + + + + + +
+
 
+
+> shape=box style=filled] + edge [color="#000000:#FFFFFF:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w edge [color="#000000:#895956:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] X1:p3r:e -- W1:w3:w W1:w3:e -- X2:p4l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p3l:w - W1 [label=< - - - - -
- - -
W1
-
- - - - -
4x0.25 mm² (24 AWG)1 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1 - 1:WH - X2:1
- - - - -
-
X1:2 - 2:BN - X2:2
- - - - -
-
X1:3 - 3:GN - X2:4
- - - - -
-
X1:4 - 4:YE - X2:3
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] } diff --git a/tutorial/tutorial02.html b/tutorial/tutorial02.html index 1c64f80f9..7d129a276 100644 --- a/tutorial/tutorial02.html +++ b/tutorial/tutorial02.html @@ -1,7 +1,7 @@ - + tutorial02 - +

tutorial02

Diagram

@@ -30,149 +30,188 @@

Diagram

- - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 - + W1 - - -W1 - -4x - -0.25 mm² (24 AWG) - -1 m -  -X1:1 -     1:WH     -X2:1 - - - -X1:2 -     2:BN     -X2:2 - - - -X1:3 -     3:GN     -X2:4 - - - -X1:4 -     4:YE     -X2:3 - - - -  + + + +W1 + +4x + +0.25 mm² (24 AWG) + +1 m +  + X1:1 + +1:WH + +X2:1 + + + + X1:2 + +2:BN + +X2:2 + + + + X1:3 + +3:GN + +X2:4 + + + + X1:4 + +4:YE + +X2:3 + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + @@ -188,26 +227,26 @@

Bill of Materials

- - + + - - - - - - - - - + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, 4 x 0.25 mm²1mW1
2Connector, Molex KK 254, female, 4 pins1 2 Connector, Molex KK 254, female, 4 pins X1, X2
21mCable, 4 x 0.25 mm²W1
diff --git a/tutorial/tutorial02.png b/tutorial/tutorial02.png index bba6a5bc9..c7dbd2ece 100644 Binary files a/tutorial/tutorial02.png and b/tutorial/tutorial02.png differ diff --git a/tutorial/tutorial02.svg b/tutorial/tutorial02.svg index 6b546a1dc..5e8a68869 100644 --- a/tutorial/tutorial02.svg +++ b/tutorial/tutorial02.svg @@ -1,149 +1,188 @@ - - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 - + W1 - - -W1 - -4x - -0.25 mm² (24 AWG) - -1 m -  -X1:1 -     1:WH     -X2:1 - - - -X1:2 -     2:BN     -X2:2 - - - -X1:3 -     3:GN     -X2:4 - - - -X1:4 -     4:YE     -X2:3 - - - -  + + + +W1 + +4x + +0.25 mm² (24 AWG) + +1 m +  + X1:1 + +1:WH + +X2:1 + + + + X1:2 + +2:BN + +X2:2 + + + + X1:3 + +3:GN + +X2:4 + + + + X1:4 + +4:YE + +X2:3 + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/tutorial/tutorial02.tsv b/tutorial/tutorial02.tsv new file mode 100644 index 000000000..da57a6a14 --- /dev/null +++ b/tutorial/tutorial02.tsv @@ -0,0 +1,3 @@ +# Qty Unit Description Designators +1 2 Connector, Molex KK 254, female, 4 pins X1, X2 +2 1 m Cable, 4 x 0.25 mm² W1 diff --git a/tutorial/tutorial02_wv_gvpr.gvpr b/tutorial/tutorial02_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tutorial/tutorial02_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tutorial/tutorial03.gv b/tutorial/tutorial03.gv index f37096323..fe43062f5 100644 --- a/tutorial/tutorial03.gv +++ b/tutorial/tutorial03.gv @@ -1,187 +1,270 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
GND1
VCC2
RX3
TX4
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
GND1
VCC2
RX3
TX4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
1GND
2VCC
3RX
4TX
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2VCC
3RX
4TX
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffffff:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + + +
4x0.25 mm² (24 AWG)+ S1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND 1:WH X2:1:GND
+ + + + + + + + + + +
+
X1:2:VCC 2:BN X2:2:VCC
+ + + + + + + + + + +
+
X1:3:RX 3:GN X2:4:TX
+ + + + + + + + + + +
+
X1:4:TX 4:YE X2:3:RX
+ + + + + + + + + + +
+
 
X1:1:GND Shield
+ + + + +
+
 
+
+> shape=box style=filled] + edge [color="#000000:#FFFFFF:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w edge [color="#000000:#895956:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w - edge [color="#000000:#00ff00:#000000"] + edge [color="#000000:#00AA00:#000000"] X1:p3r:e -- W1:w3:w W1:w3:e -- X2:p4l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p3l:w edge [color="#000000"] - X1:p1r:e -- W1:ws:w - W1 [label=< - - - - -
- - -
W1
-
- - - - - -
4x0.25 mm² (24 AWG)+ S1 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - 1:WH - X2:1:GND
- - - - -
-
X1:2:VCC - 2:BN - X2:2:VCC
- - - - -
-
X1:3:RX - 3:GN - X2:4:TX
- - - - -
-
X1:4:TX - 4:YE - X2:3:RX
- - - - -
-
 
X1:1:GNDShield
 
-
-> fillcolor="#FFFFFF" shape=box style=filled] + X1:p1r:e -- W1:w5:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000" straight=straight] } diff --git a/tutorial/tutorial03.html b/tutorial/tutorial03.html index 6ac13c6d0..1ac9ac10e 100644 --- a/tutorial/tutorial03.html +++ b/tutorial/tutorial03.html @@ -1,7 +1,7 @@ - + tutorial03 - +

tutorial03

Diagram

@@ -30,176 +30,223 @@

Diagram

- - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -RX - -3 - -TX - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 - + W1 - - -W1 - -4x - -0.25 mm² (24 AWG) - -+ S - -1 m -  -X1:1:GND -     1:WH     -X2:1:GND - - - -X1:2:VCC -     2:BN     -X2:2:VCC - - - -X1:3:RX -     3:GN     -X2:4:TX - - - -X1:4:TX -     4:YE     -X2:3:RX - - - -  -X1:1:GND -Shield - -  + + + +W1 + +4x + +0.25 mm² (24 AWG) + ++ S + +1 m +  + X1:1:GND + +1:WH + +X2:1:GND + + + + X1:2:VCC + +2:BN + +X2:2:VCC + + + + X1:3:RX + +3:GN + +X2:4:TX + + + + X1:4:TX + +4:YE + +X2:3:RX + + + +  + X1:1:GND + +Shield + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -RX - -4 - -TX + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + @@ -215,26 +262,26 @@

Bill of Materials

- - + + - - - - - - - - - + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, 4 x 0.25 mm² shielded1mW1
2Connector, Molex KK 254, female, 4 pins1 2 Connector, Molex KK 254, female, 4 pins X1, X2
21mCable, 4 x 0.25 mm² shieldedW1
diff --git a/tutorial/tutorial03.png b/tutorial/tutorial03.png index 4bd8c393f..c479043cc 100644 Binary files a/tutorial/tutorial03.png and b/tutorial/tutorial03.png differ diff --git a/tutorial/tutorial03.svg b/tutorial/tutorial03.svg index d6640e48f..bd991e057 100644 --- a/tutorial/tutorial03.svg +++ b/tutorial/tutorial03.svg @@ -1,176 +1,223 @@ - - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -RX - -3 - -TX - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 - + W1 - - -W1 - -4x - -0.25 mm² (24 AWG) - -+ S - -1 m -  -X1:1:GND -     1:WH     -X2:1:GND - - - -X1:2:VCC -     2:BN     -X2:2:VCC - - - -X1:3:RX -     3:GN     -X2:4:TX - - - -X1:4:TX -     4:YE     -X2:3:RX - - - -  -X1:1:GND -Shield - -  + + + +W1 + +4x + +0.25 mm² (24 AWG) + ++ S + +1 m +  + X1:1:GND + +1:WH + +X2:1:GND + + + + X1:2:VCC + +2:BN + +X2:2:VCC + + + + X1:3:RX + +3:GN + +X2:4:TX + + + + X1:4:TX + +4:YE + +X2:3:RX + + + +  + X1:1:GND + +Shield + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -RX - -4 - -TX + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/tutorial/tutorial03.tsv b/tutorial/tutorial03.tsv new file mode 100644 index 000000000..93fe12dee --- /dev/null +++ b/tutorial/tutorial03.tsv @@ -0,0 +1,3 @@ +# Qty Unit Description Designators +1 2 Connector, Molex KK 254, female, 4 pins X1, X2 +2 1 m Cable, 4 x 0.25 mm² shielded W1 diff --git a/tutorial/tutorial03_wv_gvpr.gvpr b/tutorial/tutorial03_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tutorial/tutorial03_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tutorial/tutorial04.gv b/tutorial/tutorial04.gv index fd45c1ff3..b560cc1fe 100644 --- a/tutorial/tutorial04.gv +++ b/tutorial/tutorial04.gv @@ -1,340 +1,486 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - - +
- - -
X1
-
- - - - -
Molex KK 254male4-pin
-
- - - - - - - - - - - - - - - - - -
GND1
VCC2
SCL3
SDA4
-
- - -
to microcontroller
-
+ + + + + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex KK 254male4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
GND1
VCC2
SCL3
SDA4
+
+ + + + +
to microcontroller
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - - +
- - -
X2
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - - - - - -
1GND1
2VCC2
3SCL3
4SDA4
-
- - -
to accelerometer
-
+ + + + + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + + [] + + + + + + [] + + + + + + [] + + +
1GND1
2VCC2
3SCL3
4SDA4
+
+ + + + +
to accelerometer
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X3 [label=< - - - - - +
- - -
X3
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
1GND
2VCC
3SCL
4SDA
-
- - -
to temperature sensor
-
+ + + + + + + + + + + +
+ + + + +
X3
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2VCC
3SCL
4SDA
+
+ + + + +
to temperature sensor
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
4x24 AWG0.3 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND 1:BN X2:1:GND
+ + + + + + + + + + +
+
X1:2:VCC 2:RD X2:2:VCC
+ + + + + + + + + + +
+
X1:3:SCL 3:OG X2:3:SCL
+ + + + + + + + + + +
+
X1:4:SDA 4:YE X2:4:SDA
+ + + + + + + + + + +
+
 
+
+ + + + +
This cable is a bit longer
+
+> shape=box style=filled] edge [color="#000000:#895956:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w - edge [color="#000000:#ff8000:#000000"] + edge [color="#000000:#FF8000:#000000"] X1:p3r:e -- W1:w3:w W1:w3:e -- X2:p3l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w - W1 [label=< - - - - - + W1:w1:e -- W1:w1:w [color="#000000:#895956:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W2 [label=< +
- - -
W1
-
- - - - -
4x24 AWG0.3 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - 1:BN - X2:1:GND
- - - - -
-
X1:2:VCC - 2:RD - X2:2:VCC
- - - - -
-
X1:3:SCL - 3:OG - X2:3:SCL
- - - - -
-
X1:4:SDA - 4:YE - X2:4:SDA
- - - - -
-
 
-
- - -
This cable is a bit longer
-
+ + + + + + + + + + + +
+ + + + +
W2
+
+ + + + + + +
4x24 AWG0.1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X2:1:GND 1:BN X3:1:GND
+ + + + + + + + + + +
+
X2:2:VCC 2:RD X3:2:VCC
+ + + + + + + + + + +
+
X2:3:SCL 3:OG X3:3:SCL
+ + + + + + + + + + +
+
X2:4:SDA 4:YE X3:4:SDA
+ + + + + + + + + + +
+
 
+
+ + + + +
This cable is a bit shorter
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] edge [color="#000000:#895956:#000000"] X2:p1r:e -- W2:w1:w W2:w1:e -- X3:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X2:p2r:e -- W2:w2:w W2:w2:e -- X3:p2l:w - edge [color="#000000:#ff8000:#000000"] + edge [color="#000000:#FF8000:#000000"] X2:p3r:e -- W2:w3:w W2:w3:e -- X3:p3l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X2:p4r:e -- W2:w4:w W2:w4:e -- X3:p4l:w - W2 [label=< - - - - - -
- - -
W2
-
- - - - -
4x24 AWG0.1 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X2:1:GND - 1:BN - X3:1:GND
- - - - -
-
X2:2:VCC - 2:RD - X3:2:VCC
- - - - -
-
X2:3:SCL - 3:OG - X3:3:SCL
- - - - -
-
X2:4:SDA - 4:YE - X3:4:SDA
- - - - -
-
 
-
- - -
This cable is a bit shorter
-
-> fillcolor="#FFFFFF" shape=box style=filled] + W2:w1:e -- W2:w1:w [color="#000000:#895956:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#FFFF00:#000000" straight=straight] } diff --git a/tutorial/tutorial04.html b/tutorial/tutorial04.html index e0c3e54bf..e20816738 100644 --- a/tutorial/tutorial04.html +++ b/tutorial/tutorial04.html @@ -1,7 +1,7 @@ - + tutorial04 - +

tutorial04

Diagram

@@ -30,307 +30,384 @@

Diagram

- - - - + + + X1 - - -X1 - -Molex KK 254 - -male - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 - -to microcontroller + + + +X1 + +Molex KK 254 + +male + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 + +to microcontroller - + W1 - - -W1 - -4x - -24 AWG - -0.3 m -  -X1:1:GND -     1:BN     -X2:1:GND - - - -X1:2:VCC -     2:RD     -X2:2:VCC - - - -X1:3:SCL -     3:OG     -X2:3:SCL - - - -X1:4:SDA -     4:YE     -X2:4:SDA - - - -  - -This cable is a bit longer + + + +W1 + +4x + +24 AWG + +0.3 m +  + X1:1:GND + +1:BN + +X2:1:GND + + + + X1:2:VCC + +2:RD + +X2:2:VCC + + + + X1:3:SCL + +3:OG + +X2:3:SCL + + + + X1:4:SDA + +4:YE + +X2:4:SDA + + + +  + +This cable is a bit longer X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -1 - -2 - -VCC - -2 - -3 - -SCL - -3 - -4 - -SDA - -4 - -to accelerometer + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +1 + +2 + +VCC + +2 + +3 + +SCL + +3 + +4 + +SDA + +4 + +to accelerometer + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + W2 - - -W2 - -4x - -24 AWG - -0.1 m -  -X2:1:GND -     1:BN     -X3:1:GND - - - -X2:2:VCC -     2:RD     -X3:2:VCC - - - -X2:3:SCL -     3:OG     -X3:3:SCL - - - -X2:4:SDA -     4:YE     -X3:4:SDA - - - -  - -This cable is a bit shorter + + + +W2 + +4x + +24 AWG + +0.1 m +  + X2:1:GND + +1:BN + +X3:1:GND + + + + X2:2:VCC + +2:RD + +X3:2:VCC + + + + X2:3:SCL + +3:OG + +X3:3:SCL + + + + X2:4:SDA + +4:YE + +X3:4:SDA + + + +  + +This cable is a bit shorter - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - - -X3 - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - -to temperature sensor + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +X3 + + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + +to temperature sensor - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + @@ -346,33 +423,33 @@

Bill of Materials

- - + + - - - - - - - - - + + - - + + + + + + + + +
IdDescription# Qty UnitDescription Designators
1Cable, 4 x 24 AWG0.4mW1, W2
2Connector, Molex KK 254, female, 4 pins1 2 Connector, Molex KK 254, female, 4 pins X2, X3
3Connector, Molex KK 254, male, 4 pins2 1 Connector, Molex KK 254, male, 4 pins X1
32mCable, 4 x 24 AWGW1, W2
diff --git a/tutorial/tutorial04.png b/tutorial/tutorial04.png index 6f7975a7c..5eb5082b6 100644 Binary files a/tutorial/tutorial04.png and b/tutorial/tutorial04.png differ diff --git a/tutorial/tutorial04.svg b/tutorial/tutorial04.svg index 430a4b934..b03709324 100644 --- a/tutorial/tutorial04.svg +++ b/tutorial/tutorial04.svg @@ -1,307 +1,384 @@ - - - - + + + X1 - - -X1 - -Molex KK 254 - -male - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 - -to microcontroller + + + +X1 + +Molex KK 254 + +male + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 + +to microcontroller - + W1 - - -W1 - -4x - -24 AWG - -0.3 m -  -X1:1:GND -     1:BN     -X2:1:GND - - - -X1:2:VCC -     2:RD     -X2:2:VCC - - - -X1:3:SCL -     3:OG     -X2:3:SCL - - - -X1:4:SDA -     4:YE     -X2:4:SDA - - - -  - -This cable is a bit longer + + + +W1 + +4x + +24 AWG + +0.3 m +  + X1:1:GND + +1:BN + +X2:1:GND + + + + X1:2:VCC + +2:RD + +X2:2:VCC + + + + X1:3:SCL + +3:OG + +X2:3:SCL + + + + X1:4:SDA + +4:YE + +X2:4:SDA + + + +  + +This cable is a bit longer X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -1 - -2 - -VCC - -2 - -3 - -SCL - -3 - -4 - -SDA - -4 - -to accelerometer + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +1 + +2 + +VCC + +2 + +3 + +SCL + +3 + +4 + +SDA + +4 + +to accelerometer + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + W2 - - -W2 - -4x - -24 AWG - -0.1 m -  -X2:1:GND -     1:BN     -X3:1:GND - - - -X2:2:VCC -     2:RD     -X3:2:VCC - - - -X2:3:SCL -     3:OG     -X3:3:SCL - - - -X2:4:SDA -     4:YE     -X3:4:SDA - - - -  - -This cable is a bit shorter + + + +W2 + +4x + +24 AWG + +0.1 m +  + X2:1:GND + +1:BN + +X3:1:GND + + + + X2:2:VCC + +2:RD + +X3:2:VCC + + + + X2:3:SCL + +3:OG + +X3:3:SCL + + + + X2:4:SDA + +4:YE + +X3:4:SDA + + + +  + +This cable is a bit shorter - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - - -X3 - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - -to temperature sensor + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +X3 + + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + +to temperature sensor - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + diff --git a/tutorial/tutorial04.tsv b/tutorial/tutorial04.tsv new file mode 100644 index 000000000..20975dfef --- /dev/null +++ b/tutorial/tutorial04.tsv @@ -0,0 +1,4 @@ +# Qty Unit Description Designators +1 2 Connector, Molex KK 254, female, 4 pins X2, X3 +2 1 Connector, Molex KK 254, male, 4 pins X1 +3 2 m Cable, 4 x 24 AWG W1, W2 diff --git a/tutorial/tutorial04_wv_gvpr.gvpr b/tutorial/tutorial04_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tutorial/tutorial04_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tutorial/tutorial05.gv b/tutorial/tutorial05.gv index 262409440..0633b820c 100644 --- a/tutorial/tutorial05.gv +++ b/tutorial/tutorial05.gv @@ -1,94 +1,252 @@ graph { -// Graph generated by WireViz 0.4-dev +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] AUTOGENERATED_F1_1 [label=< - - +
- - - - - -
Crimp ferrule0.5 mm²OG
-
+ + +
+ + + + + + + +
Crimp ferrule0.5 mm²OG
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F1_2 [label=< - - +
- - - - - -
Crimp ferrule0.5 mm²OG
-
+ + +
+ + + + + + + +
Crimp ferrule0.5 mm²OG
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F1_3 [label=< - - +
- - - - - -
Crimp ferrule0.5 mm²OG
-
+ + +
+ + + + + + + +
Crimp ferrule0.5 mm²OG
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F1_4 [label=< - - +
- - - - - -
Crimp ferrule0.5 mm²OG
-
+ + +
+ + + + + + + +
Crimp ferrule0.5 mm²OG
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X1 [label=< - - - - +
- - -
X1
-
- - - - -
Molex 8981female4-pin
-
- - - - - - - - - - - - - - - - - -
1+12V
2GND
3GND
4+5V
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex 8981female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1+12V
2GND
3GND
4+5V
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffff00:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
4x0.5 mm²0.3 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
YE X1:1:+12V
+ + + + + + + + + + +
+
BK X1:2:GND
+ + + + + + + + + + +
+
BK X1:3:GND
+ + + + + + + + + + +
+
RD X1:4:+5V
+ + + + + + + + + + +
+
 
+
+> shape=box style="filled,dashed"] + edge [color="#000000:#FFFF00:#000000"] AUTOGENERATED_F1_1:e -- W1:w1:w W1:w1:e -- X1:p1l:w edge [color="#000000:#000000:#000000"] @@ -97,93 +255,11 @@ graph { edge [color="#000000:#000000:#000000"] AUTOGENERATED_F1_3:e -- W1:w3:w W1:w3:e -- X1:p3l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] AUTOGENERATED_F1_4:e -- W1:w4:w W1:w4:e -- X1:p4l:w - W1 [label=< - - - - -
- - -
W1
-
- - - - -
4x0.5 mm²0.3 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- YE - X1:1:+12V
- - - - -
-
- BK - X1:2:GND
- - - - -
-
- BK - X1:3:GND
- - - - -
-
- RD - X1:4:+5V
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] + W1:w1:e -- W1:w1:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#000000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#000000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/tutorial/tutorial05.html b/tutorial/tutorial05.html index a906e4a20..2f701f9e8 100644 --- a/tutorial/tutorial05.html +++ b/tutorial/tutorial05.html @@ -1,7 +1,7 @@ - + tutorial05 - +

tutorial05

Diagram

@@ -30,184 +30,230 @@

Diagram

- - - - + + + AUTOGENERATED_F1_1 - - -Crimp ferrule - -0.5 mm² - -OG - - + + + +Crimp ferrule + +0.5 mm² + +OG + + - + W1 - - -W1 - -4x - -0.5 mm² - -0.3 m -  -     YE     -X1:1:+12V - - - -     BK     -X1:2:GND - - - -     BK     -X1:3:GND - - - -     RD     -X1:4:+5V - - - -  + + + +W1 + +4x + +0.5 mm² + +0.3 m +  + + +YE + +X1:1:+12V + + + + + +BK + +X1:2:GND + + + + + +BK + +X1:3:GND + + + + + +RD + +X1:4:+5V + + + +  AUTOGENERATED_F1_1:e--W1:w - - - + + + - - -AUTOGENERATED_F1_2 - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - + -AUTOGENERATED_F1_2:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F1_3 - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - + -AUTOGENERATED_F1_3:e--W1:w - - - - - - -AUTOGENERATED_F1_4 - - -Crimp ferrule - -0.5 mm² - -OG - - - - - -AUTOGENERATED_F1_4:e--W1:w - - - +W1:e--W1:w + + + - + X1 - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +AUTOGENERATED_F1_2 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_2:e--W1:w + + + + + + +AUTOGENERATED_F1_3 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_3:e--W1:w + + + + + + +AUTOGENERATED_F1_4 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_4:e--W1:w + + + @@ -223,45 +269,45 @@

Bill of Materials

- - + + - - + + - - + + - - - + + + - - - + + + - - - + + +
IdDescription# Qty UnitDescription Designators
1Connector, Crimp ferrule, 0.5 mm², OG1 4 Connector, Crimp ferrule, 0.5 mm², OG
2Connector, Molex 8981, female, 4 pins2 1 Connector, Molex 8981, female, 4 pins X1
3Wire, 0.5 mm², BK0.632 mWire, 0.5 mm², BK W1
4Wire, 0.5 mm², RD0.341 mWire, 0.5 mm², RD W1
5Wire, 0.5 mm², YE0.351 mWire, 0.5 mm², YE W1
diff --git a/tutorial/tutorial05.png b/tutorial/tutorial05.png index 44e745ad1..d0c6e81a5 100644 Binary files a/tutorial/tutorial05.png and b/tutorial/tutorial05.png differ diff --git a/tutorial/tutorial05.svg b/tutorial/tutorial05.svg index 389147b27..88a3d1dbd 100644 --- a/tutorial/tutorial05.svg +++ b/tutorial/tutorial05.svg @@ -1,184 +1,230 @@ - - - - + + + AUTOGENERATED_F1_1 - - -Crimp ferrule - -0.5 mm² - -OG - - + + + +Crimp ferrule + +0.5 mm² + +OG + + - + W1 - - -W1 - -4x - -0.5 mm² - -0.3 m -  -     YE     -X1:1:+12V - - - -     BK     -X1:2:GND - - - -     BK     -X1:3:GND - - - -     RD     -X1:4:+5V - - - -  + + + +W1 + +4x + +0.5 mm² + +0.3 m +  + + +YE + +X1:1:+12V + + + + + +BK + +X1:2:GND + + + + + +BK + +X1:3:GND + + + + + +RD + +X1:4:+5V + + + +  AUTOGENERATED_F1_1:e--W1:w - - - + + + - - -AUTOGENERATED_F1_2 - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - + -AUTOGENERATED_F1_2:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F1_3 - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - + -AUTOGENERATED_F1_3:e--W1:w - - - - - - -AUTOGENERATED_F1_4 - - -Crimp ferrule - -0.5 mm² - -OG - - - - - -AUTOGENERATED_F1_4:e--W1:w - - - +W1:e--W1:w + + + - + X1 - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +AUTOGENERATED_F1_2 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_2:e--W1:w + + + + + + +AUTOGENERATED_F1_3 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_3:e--W1:w + + + + + + +AUTOGENERATED_F1_4 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_4:e--W1:w + + + diff --git a/tutorial/tutorial05.tsv b/tutorial/tutorial05.tsv new file mode 100644 index 000000000..3c01ee36a --- /dev/null +++ b/tutorial/tutorial05.tsv @@ -0,0 +1,6 @@ +# Qty Unit Description Designators +1 4 Connector, Crimp ferrule, 0.5 mm², OG +2 1 Connector, Molex 8981, female, 4 pins X1 +3 2 m Wire, 0.5 mm², BK W1 +4 1 m Wire, 0.5 mm², RD W1 +5 1 m Wire, 0.5 mm², YE W1 diff --git a/tutorial/tutorial05_wv_gvpr.gvpr b/tutorial/tutorial05_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tutorial/tutorial05_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tutorial/tutorial06.gv b/tutorial/tutorial06.gv index 472fa8b2e..460306cb4 100644 --- a/tutorial/tutorial06.gv +++ b/tutorial/tutorial06.gv @@ -1,82 +1,236 @@ graph { -// Graph generated by WireViz 0.4-dev +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] AUTOGENERATED_F_05_1 [label=< - - +
- - - - - -
Crimp ferrule0.5 mm²OG
-
+ + +
+ + + + + + + +
Crimp ferrule0.5 mm²OG
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] F1 [label=< - - +
- - - - - -
Crimp ferrule1.0 mm²YE
-
+ + +
+ + + + + + + +
Crimp ferrule1.0 mm²YE
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] AUTOGENERATED_F_05_2 [label=< - - +
- - - - - -
Crimp ferrule0.5 mm²OG
-
+ + +
+ + + + + + + +
Crimp ferrule0.5 mm²OG
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X1 [label=< - - - - +
- - -
X1
-
- - - - -
Molex 8981female4-pin
-
- - - - - - - - - - - - - - - - - -
1+12V
2GND
3GND
4+5V
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex 8981female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1+12V
2GND
3GND
4+5V
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffff00:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
4x0.5 mm²0.3 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
YE X1:1:+12V
+ + + + + + + + + + +
+
F1 BK X1:2:GND
+ + + + + + + + + + +
+
F1 BK X1:3:GND
+ + + + + + + + + + +
+
RD X1:4:+5V
+ + + + + + + + + + +
+
 
+
+> shape=box style="filled,dashed"] + edge [color="#000000:#FFFF00:#000000"] AUTOGENERATED_F_05_1:e -- W1:w1:w W1:w1:e -- X1:p1l:w edge [color="#000000:#000000:#000000"] @@ -85,93 +239,11 @@ graph { edge [color="#000000:#000000:#000000"] F1:e -- W1:w3:w W1:w3:e -- X1:p3l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] AUTOGENERATED_F_05_2:e -- W1:w4:w W1:w4:e -- X1:p4l:w - W1 [label=< - - - - -
- - -
W1
-
- - - - -
4x0.5 mm²0.3 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- YE - X1:1:+12V
- - - - -
-
- BK - X1:2:GND
- - - - -
-
- BK - X1:3:GND
- - - - -
-
- RD - X1:4:+5V
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] + W1:w1:e -- W1:w1:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#000000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#000000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/tutorial/tutorial06.html b/tutorial/tutorial06.html index 8fba71334..de30033f0 100644 --- a/tutorial/tutorial06.html +++ b/tutorial/tutorial06.html @@ -1,7 +1,7 @@ - + tutorial06 - +

tutorial06

Diagram

@@ -30,171 +30,216 @@

Diagram

- - - - + + + AUTOGENERATED_F_05_1 - - -Crimp ferrule - -0.5 mm² - -OG - - + + + +Crimp ferrule + +0.5 mm² + +OG + + - + W1 - - -W1 - -4x - -0.5 mm² - -0.3 m -  -     YE     -X1:1:+12V - - - -     BK     -X1:2:GND - - - -     BK     -X1:3:GND - - - -     RD     -X1:4:+5V - - - -  + + + +W1 + +4x + +0.5 mm² + +0.3 m +  + + +YE + +X1:1:+12V + + + + F1 + +BK + +X1:2:GND + + + + F1 + +BK + +X1:3:GND + + + + + +RD + +X1:4:+5V + + + +  AUTOGENERATED_F_05_1:e--W1:w - - - + + + - - -F1 - - -Crimp ferrule - -1.0 mm² - -YE - - + + +W1:e--W1:w + + + - + -F1:e--W1:w - - - +W1:e--W1:w + + + - - -F1:e--W1:w - - - - - - -AUTOGENERATED_F_05_2 - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - - -AUTOGENERATED_F_05_2:e--W1:w - - - + + +W1:e--W1:w + + + - + X1 - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +F1 + + + +Crimp ferrule + +1.0 mm² + +YE + + + + + +F1:e--W1:w + + + + + + +F1:e--W1:w + + + + + + +AUTOGENERATED_F_05_2 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F_05_2:e--W1:w + + + @@ -210,52 +255,52 @@

Bill of Materials

- - + + - - + + - - + - + + - - + + - - - + + + - - - + + + - - - + + +
IdDescription# Qty UnitDescription Designators
1Connector, Crimp ferrule, 0.5 mm², OG1 2 Connector, Crimp ferrule, 0.5 mm², OG
2Connector, Crimp ferrule, 1.0 mm², YE2 1 Connector, Crimp ferrule, 1.0 mm², YEF1
3Connector, Molex 8981, female, 4 pins3 1 Connector, Molex 8981, female, 4 pins X1
4Wire, 0.5 mm², BK0.642 mWire, 0.5 mm², BK W1
5Wire, 0.5 mm², RD0.351 mWire, 0.5 mm², RD W1
6Wire, 0.5 mm², YE0.361 mWire, 0.5 mm², YE W1
diff --git a/tutorial/tutorial06.png b/tutorial/tutorial06.png index 43e00cbd0..fbc8c089c 100644 Binary files a/tutorial/tutorial06.png and b/tutorial/tutorial06.png differ diff --git a/tutorial/tutorial06.svg b/tutorial/tutorial06.svg index 99f611929..589f11a5a 100644 --- a/tutorial/tutorial06.svg +++ b/tutorial/tutorial06.svg @@ -1,171 +1,216 @@ - - - - + + + AUTOGENERATED_F_05_1 - - -Crimp ferrule - -0.5 mm² - -OG - - + + + +Crimp ferrule + +0.5 mm² + +OG + + - + W1 - - -W1 - -4x - -0.5 mm² - -0.3 m -  -     YE     -X1:1:+12V - - - -     BK     -X1:2:GND - - - -     BK     -X1:3:GND - - - -     RD     -X1:4:+5V - - - -  + + + +W1 + +4x + +0.5 mm² + +0.3 m +  + + +YE + +X1:1:+12V + + + + F1 + +BK + +X1:2:GND + + + + F1 + +BK + +X1:3:GND + + + + + +RD + +X1:4:+5V + + + +  AUTOGENERATED_F_05_1:e--W1:w - - - + + + - - -F1 - - -Crimp ferrule - -1.0 mm² - -YE - - + + +W1:e--W1:w + + + - + -F1:e--W1:w - - - - - - -F1:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F_05_2 - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - - -AUTOGENERATED_F_05_2:e--W1:w - - - + + +W1:e--W1:w + + + - + X1 - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +F1 + + + +Crimp ferrule + +1.0 mm² + +YE + + + + + +F1:e--W1:w + + + + + + +F1:e--W1:w + + + + + + +AUTOGENERATED_F_05_2 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F_05_2:e--W1:w + + + diff --git a/tutorial/tutorial06.tsv b/tutorial/tutorial06.tsv new file mode 100644 index 000000000..8dd2bff65 --- /dev/null +++ b/tutorial/tutorial06.tsv @@ -0,0 +1,7 @@ +# Qty Unit Description Designators +1 2 Connector, Crimp ferrule, 0.5 mm², OG +2 1 Connector, Crimp ferrule, 1.0 mm², YE F1 +3 1 Connector, Molex 8981, female, 4 pins X1 +4 2 m Wire, 0.5 mm², BK W1 +5 1 m Wire, 0.5 mm², RD W1 +6 1 m Wire, 0.5 mm², YE W1 diff --git a/tutorial/tutorial06_wv_gvpr.gvpr b/tutorial/tutorial06_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tutorial/tutorial06_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tutorial/tutorial07.gv b/tutorial/tutorial07.gv index ff6568854..5b4006bde 100644 --- a/tutorial/tutorial07.gv +++ b/tutorial/tutorial07.gv @@ -1,713 +1,1027 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - +
- - -
X1
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
GND1
VCC2
SCL3
SDA4
-
+ + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
GND1
VCC2
SCL3
SDA4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - +
- - -
X2
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
1GND
2VCC
3SCL
4SDA
-
+ + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2VCC
3SCL
4SDA
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X3 [label=< - - - - +
- - -
X3
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
GND1
VCC2
SCL3
SDA4
-
+ + + + + + + + +
+ + + + +
X3
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
GND1
VCC2
SCL3
SDA4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X4 [label=< - - - - +
- - -
X4
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
1GND
2VCC
3SCL
4SDA
-
+ + + + + + + + +
+ + + + +
X4
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2VCC
3SCL
4SDA
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X5 [label=< - - - - +
- - -
X5
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
GND1
VCC2
SCL3
SDA4
-
+ + + + + + + + +
+ + + + +
X5
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
GND1
VCC2
SCL3
SDA4
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X6 [label=< - - - - +
- - -
X6
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - - - - - -
1GND
2VCC
3SCL
4SDA
-
+ + + + + + + + +
+ + + + +
X6
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1GND
2VCC
3SCL
4SDA
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#00ffff:#000000"] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND TQ X2:1:GND
+ + + + + + + + + + +
+
X1:2:VCC PK X2:2:VCC
+ + + + + + + + + + +
+
X1:3:SCL YE X2:3:SCL
+ + + + + + + + + + +
+
X1:4:SDA VT X2:4:SDA
+ + + + + + + + + + +
+
 
+
+> shape=box style="filled,dashed"] + edge [color="#000000:#00FFFF:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w - edge [color="#000000:#ff66cc:#000000"] + edge [color="#000000:#FF66CC:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X1:p3r:e -- W1:w3:w W1:w3:e -- X2:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w - W1 [label=< - - - - + W1:w1:e -- W1:w1:w [color="#000000:#00FFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF66CC:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#8000FF:#000000" straight=straight] + W2 [label=< +
- - -
W1
-
- - - - -
4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1:GND - TQ - X2:1:GND
- - - - -
-
X1:2:VCC - PK - X2:2:VCC
- - - - -
-
X1:3:SCL - YE - X2:3:SCL
- - - - -
-
X1:4:SDA - VT - X2:4:SDA
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W2
+
+ + + + + + +
4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X3:1:GND TQ X2:1:GND
+ + + + + + + + + + +
+
X3:2:VCC PK X2:2:VCC
+ + + + + + + + + + +
+
X3:3:SCL YE X2:3:SCL
+ + + + + + + + + + +
+
X3:4:SDA VT X2:4:SDA
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] - edge [color="#000000:#00ffff:#000000"] +> shape=box style="filled,dashed"] + edge [color="#000000:#00FFFF:#000000"] X3:p1r:e -- W2:w1:w W2:w1:e -- X2:p1l:w - edge [color="#000000:#ff66cc:#000000"] + edge [color="#000000:#FF66CC:#000000"] X3:p2r:e -- W2:w2:w W2:w2:e -- X2:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X3:p3r:e -- W2:w3:w W2:w3:e -- X2:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X3:p4r:e -- W2:w4:w W2:w4:e -- X2:p4l:w - W2 [label=< - - - - + W2:w1:e -- W2:w1:w [color="#000000:#00FFFF:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#FF66CC:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#8000FF:#000000" straight=straight] + W3 [label=< +
- - -
W2
-
- - - - -
4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X3:1:GND - TQ - X2:1:GND
- - - - -
-
X3:2:VCC - PK - X2:2:VCC
- - - - -
-
X3:3:SCL - YE - X2:3:SCL
- - - - -
-
X3:4:SDA - VT - X2:4:SDA
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W3
+
+ + + + + + +
4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X3:1:GND TQ X4:1:GND
+ + + + + + + + + + +
+
X3:2:VCC PK X4:2:VCC
+ + + + + + + + + + +
+
X3:3:SCL YE X4:3:SCL
+ + + + + + + + + + +
+
X3:4:SDA VT X4:4:SDA
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] - edge [color="#000000:#00ffff:#000000"] +> shape=box style="filled,dashed"] + edge [color="#000000:#00FFFF:#000000"] X3:p1r:e -- W3:w1:w W3:w1:e -- X4:p1l:w - edge [color="#000000:#ff66cc:#000000"] + edge [color="#000000:#FF66CC:#000000"] X3:p2r:e -- W3:w2:w W3:w2:e -- X4:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X3:p3r:e -- W3:w3:w W3:w3:e -- X4:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X3:p4r:e -- W3:w4:w W3:w4:e -- X4:p4l:w - W3 [label=< - - - - + W3:w1:e -- W3:w1:w [color="#000000:#00FFFF:#000000" straight=straight] + W3:w2:e -- W3:w2:w [color="#000000:#FF66CC:#000000" straight=straight] + W3:w3:e -- W3:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W3:w4:e -- W3:w4:w [color="#000000:#8000FF:#000000" straight=straight] + W4 [label=< +
- - -
W3
-
- - - - -
4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X3:1:GND - TQ - X4:1:GND
- - - - -
-
X3:2:VCC - PK - X4:2:VCC
- - - - -
-
X3:3:SCL - YE - X4:3:SCL
- - - - -
-
X3:4:SDA - VT - X4:4:SDA
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W4
+
+ + + + + + +
4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X5:1:GND TQ X4:1:GND
+ + + + + + + + + + +
+
X5:2:VCC PK X4:2:VCC
+ + + + + + + + + + +
+
X5:3:SCL YE X4:3:SCL
+ + + + + + + + + + +
+
X5:4:SDA VT X4:4:SDA
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] - edge [color="#000000:#00ffff:#000000"] +> shape=box style="filled,dashed"] + edge [color="#000000:#00FFFF:#000000"] X5:p1r:e -- W4:w1:w W4:w1:e -- X4:p1l:w - edge [color="#000000:#ff66cc:#000000"] + edge [color="#000000:#FF66CC:#000000"] X5:p2r:e -- W4:w2:w W4:w2:e -- X4:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X5:p3r:e -- W4:w3:w W4:w3:e -- X4:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X5:p4r:e -- W4:w4:w W4:w4:e -- X4:p4l:w - W4 [label=< - - - - + W4:w1:e -- W4:w1:w [color="#000000:#00FFFF:#000000" straight=straight] + W4:w2:e -- W4:w2:w [color="#000000:#FF66CC:#000000" straight=straight] + W4:w3:e -- W4:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W4:w4:e -- W4:w4:w [color="#000000:#8000FF:#000000" straight=straight] + W5 [label=< +
- - -
W4
-
- - - - -
4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X5:1:GND - TQ - X4:1:GND
- - - - -
-
X5:2:VCC - PK - X4:2:VCC
- - - - -
-
X5:3:SCL - YE - X4:3:SCL
- - - - -
-
X5:4:SDA - VT - X4:4:SDA
- - - - -
-
 
-
+ + + + + + + + +
+ + + + +
W5
+
+ + + + + + +
4x0.25 mm²0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X5:1:GND TQ X6:1:GND
+ + + + + + + + + + +
+
X5:2:VCC PK X6:2:VCC
+ + + + + + + + + + +
+
X5:3:SCL YE X6:3:SCL
+ + + + + + + + + + +
+
X5:4:SDA VT X6:4:SDA
+ + + + + + + + + + +
+
 
+
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] - edge [color="#000000:#00ffff:#000000"] +> shape=box style="filled,dashed"] + edge [color="#000000:#00FFFF:#000000"] X5:p1r:e -- W5:w1:w W5:w1:e -- X6:p1l:w - edge [color="#000000:#ff66cc:#000000"] + edge [color="#000000:#FF66CC:#000000"] X5:p2r:e -- W5:w2:w W5:w2:e -- X6:p2l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X5:p3r:e -- W5:w3:w W5:w3:e -- X6:p3l:w - edge [color="#000000:#8000ff:#000000"] + edge [color="#000000:#8000FF:#000000"] X5:p4r:e -- W5:w4:w W5:w4:e -- X6:p4l:w - W5 [label=< - - - - -
- - -
W5
-
- - - - -
4x0.25 mm²0.2 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X5:1:GND - TQ - X6:1:GND
- - - - -
-
X5:2:VCC - PK - X6:2:VCC
- - - - -
-
X5:3:SCL - YE - X6:3:SCL
- - - - -
-
X5:4:SDA - VT - X6:4:SDA
- - - - -
-
 
-
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] + W5:w1:e -- W5:w1:w [color="#000000:#00FFFF:#000000" straight=straight] + W5:w2:e -- W5:w2:w [color="#000000:#FF66CC:#000000" straight=straight] + W5:w3:e -- W5:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W5:w4:e -- W5:w4:w [color="#000000:#8000FF:#000000" straight=straight] } diff --git a/tutorial/tutorial07.html b/tutorial/tutorial07.html index 181abea82..6b6078a04 100644 --- a/tutorial/tutorial07.html +++ b/tutorial/tutorial07.html @@ -1,7 +1,7 @@ - + tutorial07 - +

tutorial07

Diagram

@@ -30,661 +30,852 @@

Diagram

- - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - -W1 - -4x - -0.25 mm² - -0.2 m -  -X1:1:GND -     TQ     -X2:1:GND - - - -X1:2:VCC -     PK     -X2:2:VCC - - - -X1:3:SCL -     YE     -X2:3:SCL - - - -X1:4:SDA -     VT     -X2:4:SDA - - - -  + + + +W1 + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +TQ + +X2:1:GND + + + + X1:2:VCC + +PK + +X2:2:VCC + + + + X1:3:SCL + +YE + +X2:3:SCL + + + + X1:4:SDA + +VT + +X2:4:SDA + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + X3 - - -X3 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X3 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W2 - - -W2 - -4x - -0.25 mm² - -0.2 m -  -X3:1:GND -     TQ     -X2:1:GND - - - -X3:2:VCC -     PK     -X2:2:VCC - - - -X3:3:SCL -     YE     -X2:3:SCL - - - -X3:4:SDA -     VT     -X2:4:SDA - - - -  + + + +W2 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +TQ + +X2:1:GND + + + + X3:2:VCC + +PK + +X2:2:VCC + + + + X3:3:SCL + +YE + +X2:3:SCL + + + + X3:4:SDA + +VT + +X2:4:SDA + + + +  - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + W3 - - -W3 - -4x - -0.25 mm² - -0.2 m -  -X3:1:GND -     TQ     -X4:1:GND - - - -X3:2:VCC -     PK     -X4:2:VCC - - - -X3:3:SCL -     YE     -X4:3:SCL - - - -X3:4:SDA -     VT     -X4:4:SDA - - - -  + + + +W3 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +TQ + +X4:1:GND + + + + X3:2:VCC + +PK + +X4:2:VCC + + + + X3:3:SCL + +YE + +X4:3:SCL + + + + X3:4:SDA + +VT + +X4:4:SDA + + + +  X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + X4 - - -X4 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X4 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + - + X5 - - -X5 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X5 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W4 - - -W4 - -4x - -0.25 mm² - -0.2 m -  -X5:1:GND -     TQ     -X4:1:GND - - - -X5:2:VCC -     PK     -X4:2:VCC - - - -X5:3:SCL -     YE     -X4:3:SCL - - - -X5:4:SDA -     VT     -X4:4:SDA - - - -  + + + +W4 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +TQ + +X4:1:GND + + + + X5:2:VCC + +PK + +X4:2:VCC + + + + X5:3:SCL + +YE + +X4:3:SCL + + + + X5:4:SDA + +VT + +X4:4:SDA + + + +  - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + W5 - - -W5 - -4x - -0.25 mm² - -0.2 m -  -X5:1:GND -     TQ     -X6:1:GND - - - -X5:2:VCC -     PK     -X6:2:VCC - - - -X5:3:SCL -     YE     -X6:3:SCL - - - -X5:4:SDA -     VT     -X6:4:SDA - - - -  + + + +W5 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +TQ + +X6:1:GND + + + + X5:2:VCC + +PK + +X6:2:VCC + + + + X5:3:SCL + +YE + +X6:3:SCL + + + + X5:4:SDA + +VT + +X6:4:SDA + + + +  - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - - - - -X6 - - -X6 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +X6 + + + +X6 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + @@ -700,45 +891,45 @@

Bill of Materials

- - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + +
IdDescription# Qty UnitDescription Designators
1Connector, Molex KK 254, female, 4 pins1 6 Connector, Molex KK 254, female, 4 pins X1, X2, X3, X4, X5, X6
2Wire, 0.25 mm², PK1.025 mWire, 0.25 mm², PK W1, W2, W3, W4, W5
3Wire, 0.25 mm², TQ1.035 mWire, 0.25 mm², TQ W1, W2, W3, W4, W5
4Wire, 0.25 mm², VT1.045 mWire, 0.25 mm², VT W1, W2, W3, W4, W5
5Wire, 0.25 mm², YE1.055 mWire, 0.25 mm², YE W1, W2, W3, W4, W5
diff --git a/tutorial/tutorial07.png b/tutorial/tutorial07.png index c919e02b9..c4aa0b3ce 100644 Binary files a/tutorial/tutorial07.png and b/tutorial/tutorial07.png differ diff --git a/tutorial/tutorial07.svg b/tutorial/tutorial07.svg index e5cf4314f..65b2bb546 100644 --- a/tutorial/tutorial07.svg +++ b/tutorial/tutorial07.svg @@ -1,661 +1,852 @@ - - - - + + + X1 - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - -W1 - -4x - -0.25 mm² - -0.2 m -  -X1:1:GND -     TQ     -X2:1:GND - - - -X1:2:VCC -     PK     -X2:2:VCC - - - -X1:3:SCL -     YE     -X2:3:SCL - - - -X1:4:SDA -     VT     -X2:4:SDA - - - -  + + + +W1 + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +TQ + +X2:1:GND + + + + X1:2:VCC + +PK + +X2:2:VCC + + + + X1:3:SCL + +YE + +X2:3:SCL + + + + X1:4:SDA + +VT + +X2:4:SDA + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + X3 - - -X3 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X3 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W2 - - -W2 - -4x - -0.25 mm² - -0.2 m -  -X3:1:GND -     TQ     -X2:1:GND - - - -X3:2:VCC -     PK     -X2:2:VCC - - - -X3:3:SCL -     YE     -X2:3:SCL - - - -X3:4:SDA -     VT     -X2:4:SDA - - - -  + + + +W2 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +TQ + +X2:1:GND + + + + X3:2:VCC + +PK + +X2:2:VCC + + + + X3:3:SCL + +YE + +X2:3:SCL + + + + X3:4:SDA + +VT + +X2:4:SDA + + + +  - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + W3 - - -W3 - -4x - -0.25 mm² - -0.2 m -  -X3:1:GND -     TQ     -X4:1:GND - - - -X3:2:VCC -     PK     -X4:2:VCC - - - -X3:3:SCL -     YE     -X4:3:SCL - - - -X3:4:SDA -     VT     -X4:4:SDA - - - -  + + + +W3 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +TQ + +X4:1:GND + + + + X3:2:VCC + +PK + +X4:2:VCC + + + + X3:3:SCL + +YE + +X4:3:SCL + + + + X3:4:SDA + +VT + +X4:4:SDA + + + +  X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + X4 - - -X4 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X4 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + - + X5 - - -X5 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X5 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W4 - - -W4 - -4x - -0.25 mm² - -0.2 m -  -X5:1:GND -     TQ     -X4:1:GND - - - -X5:2:VCC -     PK     -X4:2:VCC - - - -X5:3:SCL -     YE     -X4:3:SCL - - - -X5:4:SDA -     VT     -X4:4:SDA - - - -  + + + +W4 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +TQ + +X4:1:GND + + + + X5:2:VCC + +PK + +X4:2:VCC + + + + X5:3:SCL + +YE + +X4:3:SCL + + + + X5:4:SDA + +VT + +X4:4:SDA + + + +  - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + W5 - - -W5 - -4x - -0.25 mm² - -0.2 m -  -X5:1:GND -     TQ     -X6:1:GND - - - -X5:2:VCC -     PK     -X6:2:VCC - - - -X5:3:SCL -     YE     -X6:3:SCL - - - -X5:4:SDA -     VT     -X6:4:SDA - - - -  + + + +W5 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +TQ + +X6:1:GND + + + + X5:2:VCC + +PK + +X6:2:VCC + + + + X5:3:SCL + +YE + +X6:3:SCL + + + + X5:4:SDA + +VT + +X6:4:SDA + + + +  - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - - - - -X6 - - -X6 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +X6 + + + +X6 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + diff --git a/tutorial/tutorial07.tsv b/tutorial/tutorial07.tsv new file mode 100644 index 000000000..62377db6b --- /dev/null +++ b/tutorial/tutorial07.tsv @@ -0,0 +1,6 @@ +# Qty Unit Description Designators +1 6 Connector, Molex KK 254, female, 4 pins X1, X2, X3, X4, X5, X6 +2 5 m Wire, 0.25 mm², PK W1, W2, W3, W4, W5 +3 5 m Wire, 0.25 mm², TQ W1, W2, W3, W4, W5 +4 5 m Wire, 0.25 mm², VT W1, W2, W3, W4, W5 +5 5 m Wire, 0.25 mm², YE W1, W2, W3, W4, W5 diff --git a/tutorial/tutorial07_wv_gvpr.gvpr b/tutorial/tutorial07_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tutorial/tutorial07_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} diff --git a/tutorial/tutorial08.gv b/tutorial/tutorial08.gv index 662bdc835..28e5fd8fd 100644 --- a/tutorial/tutorial08.gv +++ b/tutorial/tutorial08.gv @@ -1,275 +1,622 @@ graph { -// Graph generated by WireViz 0.4 +// Graph generated by WireViz 0.4-dev251 // https://github.com/formatc1702/WireViz graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] X1 [label=< - - - - - - - - +
- - -
X1
-
- - - -
Molex: 22013047Digimouse: 1234
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - -
1
2
3
4
-
- - -
Additional components
-
- - -
4 x Crimp, Molex KK 254, 22-30 AWG
Molex: 08500030
-
- - -
1 x
P/N: ABC, Molex: 45454, Mousikey: 9999
-
+ + + + + + + + + + + + + + +
+ + + + +
X1
+
+ + + + + +
Molex: 22013047Digimouse: 1234
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + [] + + + + + [] + + + + + [] + + + + + [] + + +
1
2
3
4
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
4xCrimp, Molex KK 254, 22-30 AWG
Molex: 08500030
1xTest
P/N: ABC, Molex: 45454, Mousikey: 9999
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X2 [label=< - - - - - - - - +
- - -
X2
-
- - - - -
P/N: CON4Molex: 22013047Digimouse: 1234
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - -
1
2
3
4
-
- - -
Additional components
-
- - -
4 x Crimp, Molex KK 254, 22-30 AWG
Molex: 08500030
-
- - -
1 x
P/N: ABC, Molex: 45454, Mousikey: 9999
-
+ + + + + + + + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
P/N: CON4Molex: 22013047Digimouse: 1234
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1
2
3
4
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
4xCrimp, Molex KK 254, 22-30 AWG
Molex: 08500030
1xTest
P/N: ABC, Molex: 45454, Mousikey: 9999
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] X3 [label=< - - - - - - - - +
- - -
X3
-
- - - -
Molex: 22013047Digimouse: 1234
-
- - - - -
Molex KK 254female4-pin
-
- - - - - - - - - - - - - -
1
2
3
4
-
- - -
Additional components
-
- - -
4 x Crimp, Molex KK 254, 22-30 AWG
Molex: 08500030
-
- - -
1 x
P/N: ABC, Molex: 45454, Mousikey: 9999
-
+ + + + + + + + + + + + + + +
+ + + + +
X3
+
+ + + + + +
Molex: 22013047Digimouse: 1234
+
+ + + + + + +
Molex KK 254female4-pin
+
+ + + + + [] + + + + + [] + + + + + [] + + + + + [] + +
1
2
3
4
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
4xCrimp, Molex KK 254, 22-30 AWG
Molex: 08500030
1xTest
P/N: ABC, Molex: 45454, Mousikey: 9999
+
-> fillcolor="#FFFFFF" shape=box style=filled] +> shape=box style=filled] + W1 [label=< + + + + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + +
P/N: CAB1CablesCo: ABC123Cables R Us: 999-888-777
+
+ + + + + + +
4x0.25 mm²1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1 1:BN X2:1
+ + + + + + + + + + +
+
X1:2 2:RD X2:2
+ + + + + + + + + + +
+
X1:3 3:OG X2:3
+ + + + + + + + + + +
+
X1:4 4:YE X2:4
+ + + + + + + + + + +
+
 
+
+> shape=box style=filled] edge [color="#000000:#895956:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w - edge [color="#000000:#ff8000:#000000"] + edge [color="#000000:#FF8000:#000000"] X1:p3r:e -- W1:w3:w W1:w3:e -- X2:p3l:w - edge [color="#000000:#ffff00:#000000"] + edge [color="#000000:#FFFF00:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w - W1 [label=< - - - - - + W1:w1:e -- W1:w1:w [color="#000000:#895956:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W2 [label=< +
- - -
W1
-
- - - - -
P/N: CAB1CablesCo: ABC123Cables R Us: 999-888-777
-
- - - - -
4x0.25 mm²1 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1 - 1:BN - X2:1
- - - - -
-
X1:2 - 2:RD - X2:2
- - - - -
-
X1:3 - 3:OG - X2:3
- - - - -
-
X1:4 - 4:YE - X2:4
- - - - -
-
 
-
+ + + + + + + + + + + +
+ + + + +
W2
+
+ + + + + + +
4x0.25 mm²1 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1 YE X3:1
+ + + + + + + + + + +
+
+ + + + + + +
P/N: WIRE1WiresCo: W1-YEWireShack: 1001
+
X1:2 BK X3:2
+ + + + + + + + + + +
+
+ + + + + + +
P/N: WIRE2WiresCo: W1-BKWireShack: 1002
+
X1:3 BK X3:3
+ + + + + + + + + + +
+
+ + + + + + +
P/N: WIRE2WiresCo: W1-BKWireShack: 1002
+
X1:4 RD X3:4
+ + + + + + + + + + +
+
+ + + + + + +
P/N: WIRE3WiresCo: W1-RDWireShack: 1009
+
 
+
+ + + + + + + + + + + + + +
1mSleeve, Braided nylon, black, 3mm
P/N: SLV-1
+
-> fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000:#ffff00:#000000"] +> shape=box style="filled,dashed"] + edge [color="#000000:#FFFF00:#000000"] X1:p1r:e -- W2:w1:w W2:w1:e -- X3:p1l:w edge [color="#000000:#000000:#000000"] @@ -278,131 +625,11 @@ graph { edge [color="#000000:#000000:#000000"] X1:p3r:e -- W2:w3:w W2:w3:e -- X3:p3l:w - edge [color="#000000:#ff0000:#000000"] + edge [color="#000000:#FF0000:#000000"] X1:p4r:e -- W2:w4:w W2:w4:e -- X3:p4l:w - W2 [label=< - - - - - - -
- - -
W2
-
- - - - -
4x0.25 mm²1 m
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
X1:1 - YE - X3:1
- - - - -
-
- - - - -
P/N: WIRE1WiresCo: W1-YEWireShack: 1001
-
X1:2 - BK - X3:2
- - - - -
-
- - - - -
P/N: WIRE2WiresCo: W1-BKWireShack: 1002
-
X1:3 - BK - X3:3
- - - - -
-
- - - - -
P/N: WIRE2WiresCo: W1-BKWireShack: 1002
-
X1:4 - RD - X3:4
- - - - -
-
- - - - -
P/N: WIRE3WiresCo: W1-RDWireShack: 1009
-
 
-
- - -
Additional components
-
- - -
1 m x Sleve, Braided nylon, black, 3mm
P/N: SLV-1
-
-> fillcolor="#FFFFFF" shape=box style="filled,dashed"] + W2:w1:e -- W2:w1:w [color="#000000:#FFFF00:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#000000:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#000000:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/tutorial/tutorial08.html b/tutorial/tutorial08.html index 09e560036..4f280946a 100644 --- a/tutorial/tutorial08.html +++ b/tutorial/tutorial08.html @@ -1,7 +1,7 @@ - + tutorial08 - +

tutorial08

Diagram

@@ -30,326 +30,406 @@

Diagram

- - - - + + + X1 - - -X1 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 - -Additional components - -4 x Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 - -1 x -P/N: ABC, Molex: 45454, Mousikey: 9999 + + + +X1 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W1 - - -W1 - -P/N: CAB1 - -CablesCo: ABC123 - -Cables R Us: 999-888-777 - -4x - -0.25 mm² - -1 m -  -X1:1 -     1:BN     -X2:1 - - - -X1:2 -     2:RD     -X2:2 - - - -X1:3 -     3:OG     -X2:3 - - - -X1:4 -     4:YE     -X2:4 - - - -  + + + +W1 + +P/N: CAB1 + +CablesCo: ABC123 + +Cables R Us: 999-888-777 + +4x + +0.25 mm² + +1 m +  + X1:1 + +1:BN + +X2:1 + + + + X1:2 + +2:RD + +X2:2 + + + + X1:3 + +3:OG + +X2:3 + + + + X1:4 + +4:YE + +X2:4 + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + W2 - - -W2 - -4x - -0.25 mm² - -1 m -  -X1:1 -     YE     -X3:1 - - - -P/N: WIRE1 -WiresCo: W1-YE -WireShack: 1001 -X1:2 -     BK     -X3:2 - - - -P/N: WIRE2 -WiresCo: W1-BK -WireShack: 1002 -X1:3 -     BK     -X3:3 - - - -P/N: WIRE2 -WiresCo: W1-BK -WireShack: 1002 -X1:4 -     RD     -X3:4 - - - -P/N: WIRE3 -WiresCo: W1-RD -WireShack: 1009 -  - -Additional components - -1 m x Sleve, Braided nylon, black, 3mm -P/N: SLV-1 + + + +W2 + +4x + +0.25 mm² + +1 m +  + X1:1 + +YE + +X3:1 + + + +P/N: WIRE1 +WiresCo: W1-YE +WireShack: 1001 + X1:2 + +BK + +X3:2 + + + +P/N: WIRE2 +WiresCo: W1-BK +WireShack: 1002 + X1:3 + +BK + +X3:3 + + + +P/N: WIRE2 +WiresCo: W1-BK +WireShack: 1002 + X1:4 + +RD + +X3:4 + + + +P/N: WIRE3 +WiresCo: W1-RD +WireShack: 1009 +  +1 +m +Sleeve, Braided nylon, black, 3mm +P/N: SLV-1 + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -P/N: CON4 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 - -Additional components - -4 x Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 - -1 x -P/N: ABC, Molex: 45454, Mousikey: 9999 - - - -X3 - - -X3 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 - -Additional components - -4 x Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 - -1 x -P/N: ABC, Molex: 45454, Mousikey: 9999 + + + +X2 + +P/N: CON4 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +X3 + + + +X3 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + @@ -365,10 +445,10 @@

Bill of Materials

- - + + @@ -377,94 +457,46 @@

Bill of Materials

- - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + + + + + + + - - + + @@ -473,10 +505,10 @@

Bill of Materials

- - + + @@ -485,10 +517,10 @@

Bill of Materials

- - + + @@ -496,6 +528,54 @@

Bill of Materials

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdDescription# Qty UnitDescription Designators P/N Manufacturer SPN
13X1, X2, X3ABCMolex45454Mousikey9999
2Cable, 4 x 0.25 mm²1mW1CAB1CablesCoABC123Cables R Us999-888-777
3Connector, Molex KK 254, female, 4 pins1 2 Connector, Molex KK 254, female, 4 pins X1, X3 Molex22013047Molex22013047 Digimouse 1234
4Connector, Molex KK 254, female, 4 pins2 1 Connector, Molex KK 254, female, 4 pins X2 CON4Molex22013047Molex22013047 Digimouse 1234
5Crimp, Molex KK 254, 22-30 AWG12X1, X2, X3Molex08500030
6Label, pinout information2X2, X3Label-ID-1BradyB-499
7Sleve, Braided nylon, black, 3mm3 1 mW2SLV-1Cable, 4 x 0.25 mm²W1CAB1CablesCoABC123Cables R Us999-888-777
8Wire, 0.25 mm², BK4 2 mWire, 0.25 mm², BK W2 WIRE2 WiresCo 1002
9Wire, 0.25 mm², RD5 1 mWire, 0.25 mm², RD W2 WIRE3 WiresCo 1009
10Wire, 0.25 mm², YE6 1 mWire, 0.25 mm², YE W2 WIRE1 WiresCo WireShack 1001
712Crimp, Molex KK 254, 22-30 AWGX1, X2, X3Molex08500030
81mSleeve, Braided nylon, black, 3mmW2SLV-1
93TestX1, X2, X3ABCMolex45454Mousikey9999
102Label, pinout informationLabel-ID-1BradyB-499
diff --git a/tutorial/tutorial08.png b/tutorial/tutorial08.png index b6cefb930..caad13cce 100644 Binary files a/tutorial/tutorial08.png and b/tutorial/tutorial08.png differ diff --git a/tutorial/tutorial08.svg b/tutorial/tutorial08.svg index 391897ae5..4cee6d972 100644 --- a/tutorial/tutorial08.svg +++ b/tutorial/tutorial08.svg @@ -1,326 +1,406 @@ - - - - + + + X1 - - -X1 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 - -Additional components - -4 x Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 - -1 x -P/N: ABC, Molex: 45454, Mousikey: 9999 + + + +X1 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W1 - - -W1 - -P/N: CAB1 - -CablesCo: ABC123 - -Cables R Us: 999-888-777 - -4x - -0.25 mm² - -1 m -  -X1:1 -     1:BN     -X2:1 - - - -X1:2 -     2:RD     -X2:2 - - - -X1:3 -     3:OG     -X2:3 - - - -X1:4 -     4:YE     -X2:4 - - - -  + + + +W1 + +P/N: CAB1 + +CablesCo: ABC123 + +Cables R Us: 999-888-777 + +4x + +0.25 mm² + +1 m +  + X1:1 + +1:BN + +X2:1 + + + + X1:2 + +2:RD + +X2:2 + + + + X1:3 + +3:OG + +X2:3 + + + + X1:4 + +4:YE + +X2:4 + + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + W2 - - -W2 - -4x - -0.25 mm² - -1 m -  -X1:1 -     YE     -X3:1 - - - -P/N: WIRE1 -WiresCo: W1-YE -WireShack: 1001 -X1:2 -     BK     -X3:2 - - - -P/N: WIRE2 -WiresCo: W1-BK -WireShack: 1002 -X1:3 -     BK     -X3:3 - - - -P/N: WIRE2 -WiresCo: W1-BK -WireShack: 1002 -X1:4 -     RD     -X3:4 - - - -P/N: WIRE3 -WiresCo: W1-RD -WireShack: 1009 -  - -Additional components - -1 m x Sleve, Braided nylon, black, 3mm -P/N: SLV-1 + + + +W2 + +4x + +0.25 mm² + +1 m +  + X1:1 + +YE + +X3:1 + + + +P/N: WIRE1 +WiresCo: W1-YE +WireShack: 1001 + X1:2 + +BK + +X3:2 + + + +P/N: WIRE2 +WiresCo: W1-BK +WireShack: 1002 + X1:3 + +BK + +X3:3 + + + +P/N: WIRE2 +WiresCo: W1-BK +WireShack: 1002 + X1:4 + +RD + +X3:4 + + + +P/N: WIRE3 +WiresCo: W1-RD +WireShack: 1009 +  +1 +m +Sleeve, Braided nylon, black, 3mm +P/N: SLV-1 + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - -X2 - -P/N: CON4 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 - -Additional components - -4 x Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 - -1 x -P/N: ABC, Molex: 45454, Mousikey: 9999 - - - -X3 - - -X3 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 - -Additional components - -4 x Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 - -1 x -P/N: ABC, Molex: 45454, Mousikey: 9999 + + + +X2 + +P/N: CON4 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +X3 + + + +X3 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + diff --git a/tutorial/tutorial08.tsv b/tutorial/tutorial08.tsv new file mode 100644 index 000000000..6ad266379 --- /dev/null +++ b/tutorial/tutorial08.tsv @@ -0,0 +1,11 @@ +# Qty Unit Description Designators P/N Manufacturer MPN Supplier SPN +1 2 Connector, Molex KK 254, female, 4 pins X1, X3 Molex 22013047 Digimouse 1234 +2 1 Connector, Molex KK 254, female, 4 pins X2 CON4 Molex 22013047 Digimouse 1234 +3 1 m Cable, 4 x 0.25 mm² W1 CAB1 CablesCo ABC123 Cables R Us 999-888-777 +4 2 m Wire, 0.25 mm², BK W2 WIRE2 WiresCo W1-BK WireShack 1002 +5 1 m Wire, 0.25 mm², RD W2 WIRE3 WiresCo W1-RD WireShack 1009 +6 1 m Wire, 0.25 mm², YE W2 WIRE1 WiresCo W1-YE WireShack 1001 +7 12 Crimp, Molex KK 254, 22-30 AWG X1, X2, X3 Molex 08500030 +8 1 m Sleeve, Braided nylon, black, 3mm W2 SLV-1 +9 3 Test X1, X2, X3 ABC Molex 45454 Mousikey 9999 +10 2 Label, pinout information Label-ID-1 Brady B-499 diff --git a/tutorial/tutorial08_wv_gvpr.gvpr b/tutorial/tutorial08_wv_gvpr.gvpr new file mode 100644 index 000000000..b313b38a1 --- /dev/null +++ b/tutorial/tutorial08_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +}