MCPcopy
hub / github.com/tdewolff/canvas / PolylineFromPath

Function PolylineFromPath

polyline.go:11–13  ·  view source on GitHub ↗

PolylineFromPath returns a polyline from the given path by approximating it by linear line segments, i.e. by flattening.

(p *Path)

Source from the content-addressed store, hash-verified

9
10// PolylineFromPath returns a polyline from the given path by approximating it by linear line segments, i.e. by flattening.
11func PolylineFromPath(p *Path) *Polyline {
12 return &Polyline{p.Flatten(Tolerance).Coords()}
13}
14
15// PolylineFromPathCoords returns a polyline from the given path from each of the start/end coordinates of the segments, i.e. converting all non-linear segments to linear ones.
16func PolylineFromPathCoords(p *Path) *Polyline {

Callers

nothing calls this directly

Calls 2

FlattenMethod · 0.80
CoordsMethod · 0.45

Tested by

no test coverage detected