Versions in this module Expand all Collapse all v0 v0.1.3 Sep 24, 2026 Changes in this version + const ArcToCmd + const CloseCmd + const CubeToCmd + const DefaultResolution + const LineToCmd + const MoveToCmd + const QuadToCmd + var BentleyOttmannEpsilon = 1e-8 + var Black = color.RGBA + var DebugPathIntersection = false + var Epsilon = 1e-10 + var FastStroke = false + var Identity = Matrix + var Origin = Point + var PixelTolerance = 0.1 + var Precision = 8 + var Tolerance = 0.01 + var Transparent = color.RGBA + var White = color.RGBA + func Equal(a, b float64) bool + func Interval(f, lower, upper float64) bool + func IntervalExclusive(f, lower, upper float64) bool + func SolveCubicFormula(a, b, c, d float64) (float64, float64, float64) + func SolveQuadraticFormula(a, b, c float64) (float64, float64) + type ArcsJoiner struct + GapJoiner Joiner + Limit float64 + func (j ArcsJoiner) Join(rhs, lhs *Path, halfWidth float64, pivot, n0, n1 Point, r0, r1 float64) + func (j ArcsJoiner) String() string + type BevelJoiner struct + func (BevelJoiner) Join(rhs, lhs *Path, halfWidth float64, pivot, n0, n1 Point, r0, r1 float64) + func (BevelJoiner) String() string + type ButtCapper struct + func (ButtCapper) Cap(p *Path, halfWidth float64, pivot, n0 Point) + func (ButtCapper) String() string + type CSSColor color.RGBA + func (color CSSColor) String() string + type Capper interface + Cap func(*Path, float64, Point, Point) + var ButtCap Capper = ButtCapper{} + var RoundCap Capper = RoundCapper{} + var SquareCap Capper = SquareCapper{} + type CoordinateFilter func(Point) bool + type FillRule int + const EvenOdd + const Negative + const NonZero + const Positive + func (fillRule FillRule) Fills(windings int) bool + func (fillRule FillRule) String() string + type Grad []Stop + func NewGradient() Grad + func (g *Grad) Add(t float64, c color.RGBA) + func (g Grad) At(t float64) color.RGBA + func (g Grad) ToLinear(start, end Point) *LinearGradient + func (g Grad) ToRadial(c0 Point, r0 float64, c1 Point, r1 float64) *RadialGradient + type Gradient interface + At func(x, y float64) color.RGBA + type GradientFunc func(x, y float64) color.RGBA + func (f GradientFunc) At(x, y float64) color.RGBA + type Intersection struct + Dir [2]float64 + Same bool + T [2]float64 + Tangent bool + func (z Intersection) Equals(o Intersection) bool + func (z Intersection) Into() bool + func (z Intersection) String() string + type Intersections []Intersection + func (zs Intersections) Has() bool + func (zs Intersections) HasSecant() bool + func (zs Intersections) HasTangent() bool + type Joiner interface + Join func(*Path, *Path, float64, Point, Point, Point, float64, float64) + var ArcsClipJoin Joiner = ArcsJoiner{ ... } + var ArcsJoin Joiner = ArcsJoiner{ ... } + var BevelJoin Joiner = BevelJoiner{} + var MiterClipJoin Joiner = MiterJoiner{ ... } + var MiterJoin Joiner = MiterJoiner{ ... } + var RoundJoin Joiner = RoundJoiner{} + type LinearGradient struct + End Point + Start Point + func NewLinearGradient(start, end Point) *LinearGradient + func (g *LinearGradient) At(x, y float64) color.RGBA + type Matrix [2][3]float64 + func ParallelogramCell(a, b, rot float64) Matrix + func PrimitiveCell(a, b Point) Matrix + func RectangleCell(a, b float64) Matrix + func RhombusCell(a float64) Matrix + func SquareCell(a float64) Matrix + func TileRectangle(cell Matrix, dst, src Rect) []Matrix + func (m Matrix) Decompose() (float64, float64, float64, float64, float64, float64) + func (m Matrix) Det() float64 + func (m Matrix) Dot(p Point) Point + func (m Matrix) Eigen() (float64, float64, Point, Point) + func (m Matrix) Equals(q Matrix) bool + func (m Matrix) HasRotation() bool + func (m Matrix) HasScaling() bool + func (m Matrix) HasTranslation() bool + func (m Matrix) Inv() Matrix + func (m Matrix) IsIdentity() bool + func (m Matrix) IsRigid() bool + func (m Matrix) IsRotation() bool + func (m Matrix) IsScaling() bool + func (m Matrix) IsSimilarity() bool + func (m Matrix) IsTranslation() bool + func (m Matrix) Mul(q Matrix) Matrix + func (m Matrix) Pos() (float64, float64) + func (m Matrix) ReflectX() Matrix + func (m Matrix) ReflectXAbout(x float64) Matrix + func (m Matrix) ReflectY() Matrix + func (m Matrix) ReflectYAbout(y float64) Matrix + func (m Matrix) Rotate(rot float64) Matrix + func (m Matrix) RotateAbout(rot, x, y float64) Matrix + func (m Matrix) Scale(sx, sy float64) Matrix + func (m Matrix) ScaleAbout(sx, sy, x, y float64) Matrix + func (m Matrix) Shear(sx, sy float64) Matrix + func (m Matrix) ShearAbout(sx, sy, x, y float64) Matrix + func (m Matrix) String() string + func (m Matrix) T() Matrix + func (m Matrix) ToSVG(h float64) string + func (m Matrix) Translate(x, y float64) Matrix + type MiterJoiner struct + GapJoiner Joiner + Limit float64 + func (j MiterJoiner) Join(rhs, lhs *Path, halfWidth float64, pivot, n0, n1 Point, r0, r1 float64) + func (j MiterJoiner) String() string + type Paint struct + Color color.Color + Gradient Gradient + func GradientPaint(g Gradient) Paint + func SolidPaint(c color.Color) Paint + func (p Paint) Has() bool + func (p Paint) IsColor() bool + func (p Paint) IsGradient() bool + type Path struct + func Arc(r, theta0, theta1 float64) *Path + func BeveledRectangle(w, h, r float64) *Path + func Circle(r float64) *Path + func Ellipse(rx, ry float64) *Path + func EllipticalArc(rx, ry, rot, theta0, theta1 float64) *Path + func Grid(w, h float64, nx, ny int, r float64) *Path + func Line(x, y float64) *Path + func MustParseSVGPath(s string) *Path + func NewPathFromData(d []float64) *Path + func ParseSVGPath(s string) (*Path, error) + func Rectangle(w, h float64) *Path + func RegularPolygon(n int, r float64, up bool) *Path + func RegularStarPolygon(n, d int, r float64, up bool) *Path + func RoundedRectangle(w, h, r float64) *Path + func StarPolygon(n int, R, r float64, up bool) *Path + func Triangle(r float64) *Path + func (p *Path) And(q *Path) *Path + func (p *Path) Append(qs ...*Path) *Path + func (p *Path) Arc(rx, ry, rot, theta0, theta1 float64) + func (p *Path) ArcTo(rx, ry, rot float64, large, sweep bool, x, y float64) + func (p *Path) Bounds() Rect + func (p *Path) CCW() bool + func (p *Path) Clip(x0, y0, x1, y1 float64) *Path + func (p *Path) Close() + func (p *Path) Closed() bool + func (p *Path) Contains(q *Path) bool + func (p *Path) ContainsPoint(x, y float64, fillRule FillRule) bool + func (p *Path) CoordDirections() []Point + func (p *Path) Coords() []Point + func (p *Path) Copy() *Path + func (p *Path) CopyTo(q *Path) *Path + func (p *Path) CrossingsAt(x, y float64) (int, bool) + func (p *Path) CubeTo(cpx1, cpy1, cpx2, cpy2, x, y float64) + func (p *Path) Curvature(seg int, t float64) float64 + func (p *Path) Dash(offset float64, d ...float64) *Path + func (p *Path) Data() []float64 + func (p *Path) Direction(seg int, t float64) Point + func (p *Path) Div(q *Path) *Path + func (p *Path) Empty() bool + func (p *Path) Equals(q *Path) bool + func (p *Path) FastBounds() Rect + func (p *Path) FastClip(x0, y0, x1, y1 float64) *Path + func (p *Path) Filling(fillRule FillRule) []bool + func (p *Path) Flatten(tolerance float64) *Path + func (p *Path) GobDecode(b []byte) error + func (p *Path) GobEncode() ([]byte, error) + func (p *Path) Gridsnap(spacing float64) *Path + func (p *Path) HasSubpaths() bool + func (p *Path) Intersections(q *Path) []Point + func (p *Path) IsFlat() bool + func (p *Path) Join(q *Path) *Path + func (p *Path) Len() int + func (p *Path) Length() float64 + func (p *Path) LineTo(x, y float64) + func (p *Path) Markers(first, mid, last *Path, align bool) []*Path + func (p *Path) MarshalBinary() ([]byte, error) + func (p *Path) MoveTo(x, y float64) + func (p *Path) Not(q *Path) *Path + func (p *Path) Offset(w float64, tolerance float64) *Path + func (p *Path) Or(q *Path) *Path + func (p *Path) Overlaps(q *Path) bool + func (p *Path) PointClosed() bool + func (p *Path) Pos() Point + func (p *Path) QuadTo(cpx, cpy, x, y float64) + func (p *Path) RayIntersections(x, y float64) []Intersection + func (p *Path) Relate(q *Path) (Relation, []Point) + func (p *Path) ReplaceArcs() *Path + func (p *Path) Reset() + func (p *Path) Reverse() *Path + func (p *Path) ReverseScanner() *PathReverseScanner + func (p *Path) Rotate(deg float64) *Path + func (p *Path) Same(q *Path) bool + func (p *Path) Sane() bool + func (p *Path) Scale(sx, sy float64) *Path + func (p *Path) Scanner() *PathScanner + func (p *Path) Segments() []Segment + func (p *Path) Settle(fillRule FillRule) *Path + func (p *Path) SimplifyVisvalingamWhyatt(tolerance float64) *Path + func (p *Path) Split() []*Path + func (p *Path) SplitAt(ts ...float64) []*Path + func (p *Path) StartPos() Point + func (p *Path) String() string + func (p *Path) Stroke(w float64, cr Capper, jr Joiner, tolerance float64) *Path + func (p *Path) Tile(clip *Path, cell Matrix) *Path + func (p *Path) ToPDF() string + func (p *Path) ToPS() string + func (p *Path) ToSVG() string + func (p *Path) Touches(q *Path) bool + func (p *Path) Transform(m Matrix) *Path + func (p *Path) TransformFunc(f func(float64, float64) (float64, float64)) *Path + func (p *Path) Translate(x, y float64) *Path + func (p *Path) Triangulate() ([][3]Point, [][5]Point) + func (p *Path) UnmarshalBinary(b []byte) error + func (p *Path) WindingsAt(x, y float64) (int, bool) + func (p *Path) XMonotone() *Path + func (p *Path) Xor(q *Path) *Path + type PathReverseScanner struct + func (s *PathReverseScanner) Arc() (float64, float64, float64, bool, bool) + func (s *PathReverseScanner) CP1() Point + func (s *PathReverseScanner) CP2() Point + func (s *PathReverseScanner) Cmd() float64 + func (s *PathReverseScanner) End() Point + func (s *PathReverseScanner) Path() *Path + func (s *PathReverseScanner) Scan() bool + func (s *PathReverseScanner) Start() Point + func (s *PathReverseScanner) Values() []float64 + type PathScanner struct + func (s *PathScanner) Arc() (float64, float64, float64, bool, bool) + func (s *PathScanner) CP1() Point + func (s *PathScanner) CP2() Point + func (s *PathScanner) Cmd() float64 + func (s *PathScanner) End() Point + func (s *PathScanner) Path() *Path + func (s *PathScanner) Scan() bool + func (s *PathScanner) Start() Point + func (s *PathScanner) Values() []float64 + type Paths []*Path + func (ps Paths) And(qs Paths) Paths + func (ps Paths) Div(qs Paths) Paths + func (ps Paths) Empty() bool + func (ps Paths) Merge() *Path + func (ps Paths) Not(qs Paths) Paths + func (ps Paths) Or(qs Paths) Paths + func (ps Paths) Settle(fillRule FillRule) Paths + func (ps Paths) Xor(qs Paths) Paths + type Point struct + X float64 + Y float64 + func EllipsePos(rx, ry, phi, cx, cy, theta float64) Point + func PolarPoint(angle, radius float64) Point + func (p Point) Add(q Point) Point + func (p Point) Angle() float64 + func (p Point) AngleBetween(q Point) float64 + func (p Point) Div(f float64) Point + func (p Point) Dot(q Point) float64 + func (p Point) Equals(q Point) bool + func (p Point) Gridsnap(spacing float64) Point + func (p Point) Hadamard(q Point) Point + func (p Point) Interpolate(q Point, t float64) Point + func (p Point) InterpolateX(q Point, x float64) Point + func (p Point) InterpolateY(q Point, y float64) Point + func (p Point) IsZero() bool + func (p Point) Length() float64 + func (p Point) Mul(f float64) Point + func (p Point) Neg() Point + func (p Point) Norm(length float64) Point + func (p Point) PerpDot(q Point) float64 + func (p Point) Rot(phi float64, p0 Point) Point + func (p Point) Rot90CCW() Point + func (p Point) Rot90CW() Point + func (p Point) Slope() float64 + func (p Point) String() string + func (p Point) Sub(q Point) Point + func (p Point) Transform(m Matrix) Point + type Polyline struct + func PolylineFromPath(p *Path) *Polyline + func PolylineFromPathCoords(p *Path) *Polyline + func (p *Polyline) Add(x, y float64) *Polyline + func (p *Polyline) Area() float64 + func (p *Polyline) Centroid() Point + func (p *Polyline) Close() *Polyline + func (p *Polyline) Closed() bool + func (p *Polyline) Coords() []Point + func (p *Polyline) Empty() bool + func (p *Polyline) FillCount(x, y float64) int + func (p *Polyline) Interior(x, y float64, fillRule FillRule) bool + func (p *Polyline) Len() int + func (p *Polyline) Smoothen() *Path + func (p *Polyline) ToPath() *Path + type RadialGradient struct + C0 Point + C1 Point + R0 float64 + R1 float64 + func NewRadialGradient(c0 Point, r0 float64, c1 Point, r1 float64) *RadialGradient + func (g *RadialGradient) At(x, y float64) color.RGBA + type Rect struct + X0 float64 + X1 float64 + Y0 float64 + Y1 float64 + func RectFromPoints(ps ...Point) Rect + func RectFromSize(x, y, w, h float64) Rect + func (r Rect) Add(q Rect) Rect + func (r Rect) AddPoint(p Point) Rect + func (r Rect) And(q Rect) Rect + func (r Rect) Area() float64 + func (r Rect) Center() Point + func (r Rect) ClosestPoint(p Point) Point + func (r Rect) Contains(q Rect) bool + func (r Rect) ContainsLine(a, b Point) bool + func (r Rect) ContainsPoint(p Point) bool + func (r Rect) DistanceToPoint(p Point) float64 + func (r Rect) Empty() bool + func (r Rect) Equals(q Rect) bool + func (r Rect) Expand(d float64) Rect + func (r Rect) H() float64 + func (r Rect) Overlaps(q Rect) bool + func (r Rect) OverlapsLine(a, b Point) bool + func (r Rect) String() string + func (r Rect) ToPath() *Path + func (r Rect) Touches(q Rect) bool + func (r Rect) TouchesLine(a, b Point) bool + func (r Rect) TouchesPoint(p Point) bool + func (r Rect) Transform(m Matrix) Rect + func (r Rect) Translate(x, y float64) Rect + func (r Rect) W() float64 + func (r Rect) Zero() bool + type Relation byte + func (rel Relation) Contains() bool + func (rel Relation) CoveredBy() bool + func (rel Relation) Covers() bool + func (rel Relation) Disjoint() bool + func (rel Relation) Equals() bool + func (rel Relation) Intersects() bool + func (rel Relation) Overlaps() bool + func (rel Relation) String() string + func (rel Relation) Touches() bool + func (rel Relation) Within() bool + type Resolution float64 + func DPI(dpi float64) Resolution + func DPMM(dpmm float64) Resolution + func (r Resolution) DPI() float64 + func (r Resolution) DPMM() float64 + type RoundCapper struct + func (RoundCapper) Cap(p *Path, halfWidth float64, pivot, n0 Point) + func (RoundCapper) String() string + type RoundJoiner struct + func (RoundJoiner) Join(rhs, lhs *Path, halfWidth float64, pivot, n0, n1 Point, r0, r1 float64) + func (RoundJoiner) String() string + type Segment struct + Cmd float64 + End Point + Start Point + func (seg Segment) Arc() (float64, float64, float64, bool, bool) + func (seg Segment) CP1() Point + func (seg Segment) CP2() Point + type SquareCapper struct + func (SquareCapper) Cap(p *Path, halfWidth float64, pivot, n0 Point) + func (SquareCapper) String() string + type Stop struct + Color color.RGBA + Offset float64 + type SweepEvents []*SweepPoint + func (q *SweepEvents) AddPathEndpoints(p *Path, seg int, clipping bool) int + func (q *SweepEvents) Pop() *SweepPoint + func (q *SweepEvents) Push(item *SweepPoint) + func (q *SweepEvents) Top() *SweepPoint + func (q SweepEvents) Init() + func (q SweepEvents) Less(i, j int) bool + func (q SweepEvents) Print(w io.Writer) + func (q SweepEvents) String() string + func (q SweepEvents) Swap(i, j int) + type SweepNode struct + func (n *SweepNode) Next() *SweepNode + func (n *SweepNode) Prev() *SweepNode + func (n *SweepNode) Print(w io.Writer) + type SweepPoint struct + func (a *SweepPoint) CompareH(b *SweepPoint) int + func (a *SweepPoint) CompareV(b *SweepPoint) int + func (a *SweepPoint) LessH(b *SweepPoint) bool + func (s *SweepPoint) InResult(op pathOp, fillRule FillRule) uint8 + func (s *SweepPoint) InterpolateY(x float64) float64 + func (s *SweepPoint) Reverse() + func (s *SweepPoint) SplitAt(z Point) (*SweepPoint, *SweepPoint) + func (s *SweepPoint) String() string + func (s *SweepPoint) ToleranceEdgeY(xLeft, xRight float64) (float64, float64) + type SweepStatus struct + func (s *SweepStatus) FindPrevNext(item *SweepPoint) (*SweepNode, *SweepNode) + func (s *SweepStatus) InsertAfter(n *SweepNode, item *SweepPoint) *SweepNode + func (s *SweepStatus) Remove(n *SweepNode) + func (s *SweepStatus) String() string + type VisvalingamWhyatt struct + func NewVisvalingamWhyatt(filter CoordinateFilter) *VisvalingamWhyatt + func (s *VisvalingamWhyatt) Simplify(ps []*Path, tolerance float64) *Path