File: 196.htm

package info (click to toggle)
eagle 4.16-5
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 36,508 kB
  • sloc: sh: 82; makefile: 32
file content (106 lines) | stat: -rw-r--r-- 5,832 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<html>
<head>
<title>EAGLE Help: UL_WIRE</title>
</head>
<body bgcolor=white>
<font face=Helvetica,Arial>
<hr>
<i>EAGLE Help</i>
<h1><center>UL_WIRE</center></h1>
<hr>
<b>Data members</b>
<p>
<table>
<tr><td valign=top><font face=Helvetica,Arial><tt>arc</tt>  </font></td><td valign=top><font face=Helvetica,Arial><a href=162.htm>UL_ARC</a></font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>cap</tt>          </font></td><td valign=top><font face=Helvetica,Arial><a href=156.htm>int</a> (CAP_...)</font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>curve</tt>        </font></td><td valign=top><font face=Helvetica,Arial><a href=157.htm>real</a></font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>layer</tt>        </font></td><td valign=top><font face=Helvetica,Arial><a href=156.htm>int</a></font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>style</tt>        </font></td><td valign=top><font face=Helvetica,Arial><a href=156.htm>int</a> (<tt>WIRE_STYLE_...</tt>)</font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>width</tt>        </font></td><td valign=top><font face=Helvetica,Arial><a href=156.htm>int</a></font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>x1, y1</tt>       </font></td><td valign=top><font face=Helvetica,Arial><a href=156.htm>int</a> (starting point)</font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>x2, y2</tt>       </font></td><td valign=top><font face=Helvetica,Arial><a href=156.htm>int</a> (end point)</font></td></tr>
</table>
<p>
<b>Loop members</b>
<p>
<table>
<tr><td valign=top><font face=Helvetica,Arial><tt>pieces()</tt>      </font></td><td valign=top><font face=Helvetica,Arial><a href=196.htm>UL_WIRE</a> (see note)</font></td></tr>
</table>
<p>
<b>Constants</b>
<p>
<table>
<tr><td valign=top><font face=Helvetica,Arial><tt>CAP_FLAT</tt>  </font></td><td valign=top><font face=Helvetica,Arial>flat arc ends</font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>CAP_ROUND</tt>   </font></td><td valign=top><font face=Helvetica,Arial>round arc ends</font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>WIRE_STYLE_CONTINUOUS</tt>   </font></td><td valign=top><font face=Helvetica,Arial>continuous</font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>WIRE_STYLE_LONGDASH</tt>    </font></td><td valign=top><font face=Helvetica,Arial>long dash</font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>WIRE_STYLE_SHORTDASH</tt>   </font></td><td valign=top><font face=Helvetica,Arial>short dash</font></td></tr>
<tr><td valign=top><font face=Helvetica,Arial><tt>WIRE_STYLE_DASHDOT</tt>     </font></td><td valign=top><font face=Helvetica,Arial>dash dot</font></td></tr>
</table>
<p>
<b>See also</b> <a href=164.htm>UL_BOARD</a>,
<a href=181.htm>UL_PACKAGE</a>,
<a href=189.htm>UL_SEGMENT</a>,
<a href=190.htm>UL_SHEET</a>,
<a href=191.htm>UL_SIGNAL</a>,
<a href=193.htm>UL_SYMBOL</a>,
<a href=162.htm>UL_ARC</a>
<p>
<b>Wire Style</b>
<p>
A UL_WIRE that has a <i>style</i> other than <tt>WIRE_STYLE_CONTINUOUS</tt> can use the
<tt>pieces()</tt> loop member to access the individual segments that constitute
for example a dashed wire. If <tt>pieces()</tt> is called for a UL_WIRE with
<tt>WIRE_STYLE_CONTINUOUS</tt>, a single segment will be accessible which is just
the same as the original UL_WIRE. The <tt>pieces()</tt> loop member can't be called
from a UL_WIRE that itself has been returned by a call to <tt>pieces()</tt> (this would
cause an infinite recursion).
<p>
<b>Arcs at Wire level</b>
<p>
Arcs are basically wires, with a few additional properties. At the first level
arcs are treated exactly the same as wires, meaning they have a start and an end point,
a width, layer and wire style. In addition to these an arc, at the wire level, has
a <i>cap</i> and a <i>curve</i> parameter. <i>cap</i> defines whether the arc endings
are round or flat, and <i>curve</i> defines the "curvature" of the arc. The valid
range for <i>curve</i> is <tt>-360</tt>..<tt>+360</tt>, and its value means what part of
a full circle the arc consists of. A value of <tt>90</tt>, for instance, would
result in a <tt>90&deg;</tt> arc, while <tt>180</tt> would give you a semicircle.
The maximum value of <tt>360</tt> can only be reached theoretically, since this would
mean that the arc consists of a full circle, which, because the start and end points
have to lie on the circle, would have to have an infinitely large diameter.
Positive values for <i>curve</i> mean that the arc is drawn in a mathematically positive
sense (i.e. counterclockwise). If <i>curve</i> is <tt>0</tt>, the arc is a straight
line ("no curvature"), which is actually a wire.
<p>
The <i>cap</i> parameter only has a meaning for actual arcs, and will always return
<tt>CAP_ROUND</tt> for a straight wire.
<p>
Whether or not an UL_WIRE is an arc can be determined by checking the boolean return
value of the <tt>arc</tt> data member. If it returns <tt>0</tt>, we have a straight
wire, otherwise an arc. If <tt>arc</tt> returns a non-zero value it may be further
dereferenced to access the <a href=162.htm>UL_ARC</a> specific parameters start
and end angle, radius and center point. Note that you may only need these additional
parameters if you are going to draw the arc or process it in other ways where the
actual shape is important.
<p>
<b>Example</b>
<pre>
board(B) {
  B.wires(W) {
    printf("Wire: (%d %d) (%d %d)\n",
           W.x1, W.y1, W.x2, W.y2);
    }
  }
</pre>

<hr>
<table width=100% cellspacing=0 border=0><tr><td align=left><font face=Helvetica,Arial>
<a href=index.htm>Index</a>
</font></td><td align=right><font face=Helvetica,Arial size=-1>
<i>Copyright &copy; 2005 CadSoft Computer GmbH</i>
</font></td></tr></table>
<hr>
</font>
</body>
</html>