Documentation ¶
Index ¶
- Constants
- func AlmostEqualsCoord(a, b geom.Coord) bool
- func AlmostEqualsPathCircArc(a, b *PathCircArc) bool
- func AlmostEqualsPathLines(a, b *PathLine) bool
- func FloatAlmostEqual(a, b float64) bool
- type Circle
- type Element
- type OptimizedPathCollection
- type Path
- func (me *Path) Back() PathSegment
- func (me *Path) BackPoint() *geom.Coord
- func (me *Path) Draw(svg *SVGWriter, s ...string)
- func (me *Path) Front() PathSegment
- func (me *Path) FrontPoint() *geom.Coord
- func (me *Path) PushBack(seg PathSegment)
- func (me *Path) PushFront(seg PathSegment)
- func (me *Path) PushPathBack(path *Path)
- func (me *Path) PushPathFront(path *Path)
- func (me *Path) Reverse()
- type PathCircArc
- type PathLine
- type PathSegment
- type SVGWriter
- func (svg *SVGWriter) Circle(c geom.Coord, r float64, s ...string)
- func (svg *SVGWriter) CircularArc(p1, p2 geom.Coord, r float64, largeArc, sweep bool, s ...string)
- func (svg *SVGWriter) CubicBezier(p1, ctrl1, ctrl2, p2 geom.Coord, s ...string)
- func (svg *SVGWriter) End()
- func (svg *SVGWriter) EndPath()
- func (svg *SVGWriter) Line(p1 geom.Coord, p2 geom.Coord, s ...string)
- func (svg *SVGWriter) PathCircularArcTo(p geom.Coord, r float64, largeArc, sweep bool)
- func (svg *SVGWriter) PathClose()
- func (svg *SVGWriter) PathCubicBezierTo(p, ctrl1, ctrl2 geom.Coord)
- func (svg *SVGWriter) PathLineTo(p geom.Coord)
- func (svg *SVGWriter) PathQuadBezierTo(p, ctrl1 geom.Coord)
- func (svg *SVGWriter) QuadBezier(p1 geom.Coord, ctrl1 geom.Coord, p2 geom.Coord, s ...string)
- func (svg *SVGWriter) Start(viewBox geom.Rect, s ...string)
- func (svg *SVGWriter) StartPath(p1 geom.Coord, s ...string)
Constants ¶
View Source
const FLOAT_EQUAL_THRESH = 0.00000001
Comparing floating point sucks. This is probably wrong in the general case but is good enough for this application. Don't assume I know what I'm doing here. I'm pulling stuff out of my butt.
Variables ¶
This section is empty.
Functions ¶
func AlmostEqualsCoord ¶
func AlmostEqualsPathCircArc ¶
func AlmostEqualsPathCircArc(a, b *PathCircArc) bool
func AlmostEqualsPathLines ¶
func FloatAlmostEqual ¶
Types ¶
type OptimizedPathCollection ¶
type OptimizedPathCollection struct {
Paths []*Path
}
OptimizedPathCollection takes a set of Paths and PathSegments and constructs continuous paths. This is sometimes referred to as "chains". After adding all of the Paths and PathSegments, call Optimize.
func (*OptimizedPathCollection) AddPath ¶
func (opc *OptimizedPathCollection) AddPath(np *Path)
func (*OptimizedPathCollection) AddSegment ¶
func (opc *OptimizedPathCollection) AddSegment(p PathSegment)
func (*OptimizedPathCollection) Draw ¶
func (opc *OptimizedPathCollection) Draw(svg *SVGWriter, s ...string)
func (*OptimizedPathCollection) NumPaths ¶
func (opc *OptimizedPathCollection) NumPaths() int
func (*OptimizedPathCollection) Optimize ¶
func (opc *OptimizedPathCollection) Optimize()
type Path ¶
type Path struct { Closed bool // contains filtered or unexported fields }
func (*Path) Back ¶
func (me *Path) Back() PathSegment
func (*Path) Front ¶
func (me *Path) Front() PathSegment
func (*Path) FrontPoint ¶
func (*Path) PushBack ¶
func (me *Path) PushBack(seg PathSegment)
func (*Path) PushFront ¶
func (me *Path) PushFront(seg PathSegment)
func (*Path) PushPathBack ¶
func (*Path) PushPathFront ¶
type PathCircArc ¶
func NewPathCircArc ¶
func NewPathCircArc(a, b geom.Coord, r float64, largeArc, sweep bool) *PathCircArc
func (*PathCircArc) Bounds ¶
func (a *PathCircArc) Bounds() geom.Rect
func (*PathCircArc) Equals ¶
func (a *PathCircArc) Equals(oi interface{}) bool
func (*PathCircArc) P1 ¶
func (a *PathCircArc) P1() *geom.Coord
func (*PathCircArc) P2 ¶
func (a *PathCircArc) P2() *geom.Coord
func (*PathCircArc) PathDraw ¶
func (a *PathCircArc) PathDraw(svg *SVGWriter)
func (*PathCircArc) Reverse ¶
func (a *PathCircArc) Reverse()
type PathLine ¶
func NewPathLine ¶
type PathSegment ¶
type SVGWriter ¶
type SVGWriter struct {
// contains filtered or unexported fields
}
func (*SVGWriter) CircularArc ¶
func (*SVGWriter) CubicBezier ¶
func (*SVGWriter) PathCircularArcTo ¶
func (*SVGWriter) PathCubicBezierTo ¶
func (*SVGWriter) PathLineTo ¶
func (*SVGWriter) PathQuadBezierTo ¶
func (*SVGWriter) QuadBezier ¶
Click to show internal directories.
Click to hide internal directories.