path

package
v0.15.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package path provides internal path processing utilities.

Index

Constants

View Source
const Tolerance = 0.1

Tolerance is the maximum distance from the curve for flattening.

Variables

This section is empty.

Functions

This section is empty.

Types

type Close

type Close struct{}

Close closes the path.

type CubicTo

type CubicTo struct{ Control1, Control2, Point Point }

CubicTo draws a cubic curve.

type LineTo

type LineTo struct{ Point Point }

LineTo draws a line.

type MoveTo

type MoveTo struct{ Point Point }

MoveTo moves to a point.

type PathElement

type PathElement interface {
	// contains filtered or unexported methods
}

PathElement represents an element in a path.

type Point

type Point struct {
	X, Y float64
}

Point represents a 2D point (internal copy to avoid import cycle).

func Flatten

func Flatten(elements []PathElement) []Point

Flatten converts a path with curves into a path with only straight lines.

func (Point) Add

func (p Point) Add(q Point) Point

func (Point) Distance

func (p Point) Distance(q Point) float64

func (Point) Dot

func (p Point) Dot(q Point) float64

func (Point) Length

func (p Point) Length() float64

func (Point) Lerp

func (p Point) Lerp(q Point, t float64) Point

Helper methods for Point

func (Point) Mul

func (p Point) Mul(s float64) Point

func (Point) Sub

func (p Point) Sub(q Point) Point

type QuadTo

type QuadTo struct{ Control, Point Point }

QuadTo draws a quadratic curve.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL