EAGLE Help

UL_WIRE


Data members

arc UL_ARC
cap int (CAP_...)
curve real
layer int
style int (WIRE_STYLE_...)
width int
x1, y1 int (starting point)
x2, y2 int (end point)

Loop members

pieces() UL_WIRE (see note)

Constants

CAP_FLAT flat arc ends
CAP_ROUND round arc ends
WIRE_STYLE_CONTINUOUS continuous
WIRE_STYLE_LONGDASH long dash
WIRE_STYLE_SHORTDASH short dash
WIRE_STYLE_DASHDOT dash dot

See also UL_BOARD, UL_PACKAGE, UL_SEGMENT, UL_SHEET, UL_SIGNAL, UL_SYMBOL, UL_ARC

Wire Style

A UL_WIRE that has a style other than WIRE_STYLE_CONTINUOUS can use the pieces() loop member to access the individual segments that constitute for example a dashed wire. If pieces() is called for a UL_WIRE with WIRE_STYLE_CONTINUOUS, a single segment will be accessible which is just the same as the original UL_WIRE. The pieces() loop member can't be called from a UL_WIRE that itself has been returned by a call to pieces() (this would cause an infinite recursion).

Arcs at Wire level

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 cap and a curve parameter. cap defines whether the arc endings are round or flat, and curve defines the "curvature" of the arc. The valid range for curve is -360..+360, and its value means what part of a full circle the arc consists of. A value of 90, for instance, would result in a 90° arc, while 180 would give you a semicircle. The maximum value of 360 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 curve mean that the arc is drawn in a mathematically positive sense (i.e. counterclockwise). If curve is 0, the arc is a straight line ("no curvature"), which is actually a wire.

The cap parameter only has a meaning for actual arcs, and will always return CAP_ROUND for a straight wire.

Whether or not an UL_WIRE is an arc can be determined by checking the boolean return value of the arc data member. If it returns 0, we have a straight wire, otherwise an arc. If arc returns a non-zero value it may be further dereferenced to access the UL_ARC 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.

Example

board(B) {
  B.wires(W) {
    printf("Wire: (%d %d) (%d %d)\n",
           W.x1, W.y1, W.x2, W.y2);
    }
  }

Index Copyright © 2005 CadSoft Computer GmbH