geagle/Package.go

49 lines
998 B
Go

package geagle
// A drill hole
type Hole struct {
Point
Drill string `xml:"drill,attr"`
}
type PadShape string
const (
PAD_LONG PadShape = "long"
PAD_SQUARE = "square"
PAD_ROUND = "round"
PAD_OCTAGONAL = "octagon"
PAD_OFFSET = "offset"
)
// A drilled pad
type Pad struct {
Point
Name string `xml:"name,attr"`
Drill float32 `xml:"drill,attr"`
Shape PadShape `xml:"shape,attr"`
Rotation Rotation `xml:"rot,attr,omitempty"`
}
// An undrilled smd pad
type SmdPad struct {
Point
Name string `xml:"name,attr"`
Width float32 `xml:"dx,attr"`
Height float32 `xml:"dy,attr"`
Layer int `xml:"layer,attr"`
}
// A package
// bundles all kinds of geometry shapes
type Package struct {
Name string `xml:"name,attr"`
Description string `xml:"description"`
Urn string `xml:"urn,attr,omitempty"`
Primitives
Holes []Hole `xml:"hole"`
Pads []Pad `xml:"pad"`
SmdPads []SmdPad `xml:"smd"`
}