Documentation
¶
Overview ¶
Package svg parses Gerber to SVG.
Package svg parses Gerber to SVG.
Index ¶
- func Bounds(element interface{}) (*geom.Bounds, error)
- type Arc
- type Circle
- type ElementType
- type Line
- type Path
- type PathArc
- type PathLine
- type Processor
- func (p *Processor) Arc(garc *gerber.Arc)
- func (p *Processor) Circle(circle *gerber.Circle)
- func (p *Processor) Contour(contour *gerber.Contour)
- func (p *Processor) Line(gline *gerber.Line)
- func (p *Processor) Obround(obround *gerber.Obround)
- func (p *Processor) Rectangle(rectangle *gerber.Rectangle)
- func (p *Processor) SetViewBox(box *gerber.ViewBox)
- func (p *Processor) UnmarshalJSON(b []byte) error
- func (p *Processor) UnmarshalJSON_1(b []byte) error
- func (p *Processor) Write(w io.Writer) error
- type Rectangle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Arc ¶
type Arc struct {
Type ElementType
*gerber.Arc
RadiusX float64
RadiusY float64
LargeArc int
Sweep int
Stroke string
Attr map[string]string
}
An Arc is a SVG Arc.
func (Arc) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type Circle ¶
A Circle is a circle.
func (Circle) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type ElementType ¶
type ElementType string
An ElementType is a SVG element type.
const ( ElementTypeCircle ElementType = "Circle" ElementTypeRectangle ElementType = "Rect" ElementTypePath ElementType = "Path" ElementTypeLine ElementType = "Line" ElementTypeArc ElementType = "CircularArc" )
type Path ¶
type Path struct {
Type ElementType
Line int
X float64
Y float64
Commands []interface{}
Fill string
Attr map[string]string
}
A Path is a SVG path.
func (Path) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type PathArc ¶
type PathArc struct {
Type ElementType
XRadius float64
YRadius float64
LargeArc int
Sweep int
X float64
Y float64
}
A PathArc is an arc in a SVG path.
func (PathArc) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type PathLine ¶
type PathLine struct {
Type ElementType
X float64
Y float64
}
A PathLine is a line in a SVG path.
func (PathLine) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type Processor ¶
type Processor struct {
// Data contains SVG elements.
Data []interface{}
// Viewbox of Gerber image.
*gerber.ViewBox
// Color for Gerber polarities, defaults to black and white.
PolarityDark string
PolarityClear string
// Optional scaling factor of coordinates when writing SVG image.
Scale float64
// Optional width and height of output SVG image.
Width string
Height string
// Whether to output javascript for interactive panning and zooming in SVG.
PanZoom bool
// contains filtered or unexported fields
}
A Processor is a performer of Gerber graphic operations.
func (*Processor) SetViewBox ¶
func (*Processor) UnmarshalJSON ¶
func (*Processor) UnmarshalJSON_1 ¶
Click to show internal directories.
Click to hide internal directories.