Documentation ¶
Index ¶
- Constants
- type Arc
- type Circle
- type Contour
- type Interpolation
- type Line
- type LineCap
- type LinePrimitiveNotClosedError
- type Loayer
- type LogProcessor
- func (l LogProcessor) Arc(arc *Arc)
- func (l LogProcessor) Circle(circle *Circle)
- func (l LogProcessor) Contour(contour *Contour)
- func (l LogProcessor) Line(line *Line)
- func (l LogProcessor) Obround(obround *Obround)
- func (l LogProcessor) Rectangle(rectangle *Rectangle)
- func (l LogProcessor) SetViewBox(box *ViewBox)
- type Obround
- type Parser
- type Processor
- type Rectangle
- type Segment
- type StoreProcessor
- func (s *StoreProcessor) Arc(arc *Arc)
- func (s *StoreProcessor) Circle(circle *Circle)
- func (s *StoreProcessor) Contour(contour *Contour)
- func (s *StoreProcessor) Line(line *Line)
- func (s *StoreProcessor) Obround(obround *Obround)
- func (s *StoreProcessor) Rectangle(rectangle *Rectangle)
- func (s *StoreProcessor) SetViewBox(box *ViewBox)
- type Unit
- type ViewBox
Constants ¶
View Source
const ( // Linear interpolation. InterpolationLinear Interpolation = iota // Counter clockwise arc interpolation. InterpolationCCW // Clockwise arc interpolation InterpolationClockwise InterpolationSingleQuadrant InterpolationMultiQuadrant InterpolationSingleQuadrantClockwise = 11 InterpolationSingleQuadrantCCCW = 12 InterpolationMultiQuadrantClockwise = 13 InterpolationMultiQuadrantCCW = 14 InterpolationCircularFlag = 1 InterpolationDirectionFlag = 2 InterpolationQuadrantFlag = 3 // LineCapButt strokes do not extend beyond a line's two endpoints. LineCapButt LineCap = "butt" // LineCapRound strokes will be extended by a half circle with a diameter equal to the stroke width. LineCapRound LineCap = "round" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arc ¶ added in v0.1.2
type Arc struct { Line int geom.CircularArc2 StrokeWidth float64 Interpolation }
type Line ¶ added in v0.1.2
type Line struct { LineNo int geom.LineSegment StrokeWidth float64 Cap LineCap }
type LinePrimitiveNotClosedError ¶
type LinePrimitiveNotClosedError struct { Line int First [2]float64 Last [2]float64 FirstStr [2]string LastStr [2]string }
func (LinePrimitiveNotClosedError) Error ¶
func (err LinePrimitiveNotClosedError) Error() string
type Loayer ¶
type Loayer string
const ( GTL Loayer = "GTL" //顶层走线 GBL Loayer = "GBL" //底层走线 GTO Loayer = "GTO" //顶层丝印 GBO Loayer = "GBO" //底层丝印 GTS Loayer = "GTS" // 顶层阻焊 GBS Loayer = "GBS" //底层阻焊 GPT Loayer = "GPT" //顶层主焊盘 GPB Loayer = "GPB" //底层主焊盘 G1 Loayer = "G1" //内部走线层1 G2 Loayer = "G2" //内部走线层2 G3 Loayer = "G3" //内部走线层3 G4 Loayer = "G4" //内部走线层4 GP1 Loayer = "GP1" //内平面1(负片) GP2 Loayer = "GP2" //内平面2(负片) GM1 Loayer = "GM1" //机械层1 GM2 Loayer = "GM2" //机械层2 GM3 Loayer = "GM3" //机械层3 GM4 Loayer = "GM4" //机械层4 GKO Loayer = "GKO" //禁止布线层(可做板子外形) )
type LogProcessor ¶ added in v0.3.0
type LogProcessor struct { }
func (LogProcessor) Arc ¶ added in v0.3.0
func (l LogProcessor) Arc(arc *Arc)
func (LogProcessor) Circle ¶ added in v0.3.0
func (l LogProcessor) Circle(circle *Circle)
func (LogProcessor) Contour ¶ added in v0.3.0
func (l LogProcessor) Contour(contour *Contour)
func (LogProcessor) Line ¶ added in v0.3.0
func (l LogProcessor) Line(line *Line)
func (LogProcessor) Obround ¶ added in v0.3.0
func (l LogProcessor) Obround(obround *Obround)
func (LogProcessor) Rectangle ¶ added in v0.3.0
func (l LogProcessor) Rectangle(rectangle *Rectangle)
func (LogProcessor) SetViewBox ¶ added in v0.3.0
func (l LogProcessor) SetViewBox(box *ViewBox)
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
A Parser is a Gerber format parser. For each graphical operation parsed from an input stream, Parser calls the corresponding method of its Processor.
type Processor ¶
type Processor interface { // Circle draws a circle. Circle(*Circle) // Rectangle draws a rectangle. Rectangle(*Rectangle) // Obround(oval) draws an olav. Obround(*Obround) // Contour draws a contour. Contour(*Contour) // Line draws a line. Line(*Line) // Arc draws an arc. Arc(*Arc) // SetViewbox sets the viewbox of the Gerber image. // It is called by the Parser when parsing has completed. SetViewBox(*ViewBox) }
type Segment ¶
type Segment struct { Interpolation Interpolation X float64 Y float64 CenterX float64 CenterY float64 }
A Segment is a stroked line.
type StoreProcessor ¶ added in v0.3.4
type StoreProcessor struct { Circles []*Circle Rects []*Rectangle Obrounds []*Obround Lines []*Line Contours []*Contour Arcs []*Arc ViewBox *ViewBox }
func (*StoreProcessor) Arc ¶ added in v0.3.4
func (s *StoreProcessor) Arc(arc *Arc)
func (*StoreProcessor) Circle ¶ added in v0.3.4
func (s *StoreProcessor) Circle(circle *Circle)
func (*StoreProcessor) Contour ¶ added in v0.3.4
func (s *StoreProcessor) Contour(contour *Contour)
func (*StoreProcessor) Line ¶ added in v0.3.4
func (s *StoreProcessor) Line(line *Line)
func (*StoreProcessor) Obround ¶ added in v0.3.4
func (s *StoreProcessor) Obround(obround *Obround)
func (*StoreProcessor) Rectangle ¶ added in v0.3.4
func (s *StoreProcessor) Rectangle(rectangle *Rectangle)
func (*StoreProcessor) SetViewBox ¶ added in v0.3.4
func (s *StoreProcessor) SetViewBox(box *ViewBox)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.