package svg
Import Path
oss.terrastruct.com/d2/lib/svg (on go.dev )
Dependency Relation
imports 8 packages , and imported by 4 packages
Package-Level Type Names (only one)
/* sort by: alphabet | popularity */
type SvgPathContext (struct)
Fields (total 7 )
Commands []string
Current *geo .Point
Path []geo .Intersectable
ScaleX float64
ScaleY float64
Start *geo .Point
TopLeft *geo .Point
Methods (total 9 )
(*SvgPathContext) Absolute (x, y float64 ) *geo .Point
(*SvgPathContext) C (isLowerCase bool , x1, y1, x2, y2, x3, y3 float64 )
(*SvgPathContext) H (isLowerCase bool , x float64 )
(*SvgPathContext) L (isLowerCase bool , x, y float64 )
(*SvgPathContext) PathData () string
(*SvgPathContext) Relative (base *geo .Point , dx, dy float64 ) *geo .Point
(*SvgPathContext) StartAt (p *geo .Point )
(*SvgPathContext) V (isLowerCase bool , y float64 )
(*SvgPathContext) Z ()
As Outputs Of (at least one exported )
func NewSVGPathContext (tl *geo .Point , sx, sy float64 ) *SvgPathContext
Package-Level Functions (total 6)
func BezierCurveSegment (p1, p2, p3, p4 *geo .Point , t0, t1 float64 ) (geo .Point , geo .Point , geo .Point , geo .Point )
Given control points p1, p2, p3, p4, calculate the segment of this bezier curve from t0 -> t1 where {0 <= t0 < t1 <= 1}.
Uses De Casteljau's algorithm, referenced: https://stackoverflow.com/questions/11703283/cubic-bezier-curve-segment/11704152#11704152
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .