Documentation
¶
Index ¶
- Constants
- Variables
- func Area64(path Path64) float64
- func AreaD(path PathD) float64
- func AreaPaths64(paths Paths64) float64
- func AreaPathsD(paths PathsD) float64
- func CrossProduct(pt1, pt2, pt3 Point64) float64
- func IsOdd(val int) bool
- func IsPositive64(poly Path64) bool
- func IsPositiveD(poly PathD) bool
- func NewClipper64() *clipper64
- func NewClipperD(decimalPrecision int) *clipperD
- func Path2ContainsPath1(path1, path2 Path64) bool
- func PerpendicDistFromLineSqr64(pt, line1, line2 Point64) float64
- func PerpendicDistFromLineSqrD(pt, line1, line2 PointD) float64
- func PointsNearEqual(pt1, pt2 PointD, distanceSqrd float64) bool
- func ReversePath[T any](p []T) []T
- func SwapFrontBackSides(outrec *OutRec)
- type Active
- type ClipType
- type ClipperOffset
- func (co *ClipperOffset) AddPaths(paths Paths64, joinType JoinType, endType EndType)
- func (co *ClipperOffset) CalcSolutionCapacity() int
- func (co *ClipperOffset) CheckPathsReversed() bool
- func (co *ClipperOffset) Execute64(delta float64, solution *Paths64)
- func (co *ClipperOffset) SetDeltaCallback(deltaCallback *DeltaCallbackFunc)
- type DeltaCallbackFunc
- type EndType
- type FillRule
- type Group
- type HorzJoin
- type HorzSegment
- type InflateOption
- type IntersectNode
- type JoinType
- type JoinWith
- type LocalMinima
- type Location
- type MidpointRounding
- type OutPt
- type OutPt2
- type OutRec
- type Path64
- func Ellipse64(center Point64, radiusX, radiusY float64, steps int) Path64
- func MakePath64(vals ...int64) Path64
- func OffsetPath(path Path64, dx, dy int64) Path64
- func PathDToPath64(path PathD) Path64
- func ScalePath64(path Path64, scale float64) Path64
- func ScalePathDToPath64(path PathD, scale float64) Path64
- func SimplifyPath64(path Path64, epsilon float64, isClosedPath bool) Path64
- func StripDuplicates(path Path64, isClosedPath bool) Path64
- func TranslatePath64(path Path64, dx, dy int64) Path64
- func TrimCollinear64(path Path64, isOpen bool) Path64
- type PathD
- func EllipseD(center PointD, radiusX, radiusY float64, steps int) PathD
- func MakePathD(vals ...float64) PathD
- func Path64ToPathD(path Path64) PathD
- func ScalePath64ToPathD(path Path64, scale float64) PathD
- func ScalePathD(path PathD, scale float64) PathD
- func SimplifyPathD(path PathD, epsilon float64, isClosedPath bool) PathD
- func TranslatePathD(path PathD, dx, dy float64) PathD
- func TrimCollinearD(path PathD, precision int, isOpen bool) PathD
- type PathType
- type Paths64
- func BooleanOpPaths64(clipType ClipType, subject Paths64, clip Paths64, fillRule FillRule) Paths64
- func DifferenceWithClipPaths64(subject, clip Paths64, fillRule FillRule) Paths64
- func InflatePaths64(paths Paths64, delta float64, joinType JoinType, endType EndType, ...) Paths64
- func IntersectWithClipPaths64(subject, clip Paths64, fillRule FillRule) Paths64
- func MinkowskiDiff64(pattern, path Path64, isClosed bool) Paths64
- func MinkowskiSum64(pattern, path Path64, isClosed bool) Paths64
- func PathsDToPaths64(path PathsD) Paths64
- func RectClipLinesPath64(rect Rect64, path Path64) Paths64
- func RectClipLinesPaths64(rect Rect64, paths Paths64) Paths64
- func RectClipPath64(rect Rect64, path Path64) Paths64
- func RectClipPaths64(rect Rect64, paths Paths64) Paths64
- func ScalePathsDToPaths64(paths PathsD, scale float64) Paths64
- func SimplifyPaths64(paths Paths64, epsilon float64, isClosedPaths bool) Paths64
- func TranslatePaths64(paths Paths64, dx, dy int64) Paths64
- func UnionPaths64(subject Paths64, fillRule FillRule) Paths64
- func UnionWithClipPaths64(subject, clip Paths64, fillRule FillRule) Paths64
- func XorWithClipPaths64(subject, clip Paths64, fillRule FillRule) Paths64
- type PathsD
- func BooleanOpPathsD(clipType ClipType, subject PathsD, clip PathsD, fillRule FillRule, ...) PathsD
- func DifferenceWithClipPathsD(subject, clip PathsD, fillRule FillRule, precision ...int) PathsD
- func InflatePathsD(paths PathsD, delta float64, joinType JoinType, endType EndType, ...) PathsD
- func IntersectWithClipPathsD(subject, clip PathsD, fillRule FillRule, precision ...int) PathsD
- func MinkowskiDiffD(pattern, path PathD, isClosed bool, precisionV ...int) PathsD
- func MinkowskiSumD(pattern, path PathD, isClosed bool, precisionV ...int) PathsD
- func Paths64ToPathsD(path Paths64) PathsD
- func RectClipLinesPathD(rect RectD, path PathD) PathsD
- func RectClipLinesPathsD(rect RectD, paths PathsD, precisionV ...int) PathsD
- func RectClipPathD(rect RectD, path PathD) PathsD
- func RectClipPathsD(rect RectD, paths PathsD, precisionV ...int) PathsD
- func ScalePaths64ToPathsD(paths Paths64, scale float64) PathsD
- func SimplifyPathsD(paths PathsD, epsilon float64, isClosedPaths bool) PathsD
- func TranslatePathsD(paths PathsD, dx, dy float64) PathsD
- func UnionPathsD(subject PathsD, fillRule FillRule, precision ...int) PathsD
- func UnionWithClipPathsD(subject, clip PathsD, fillRule FillRule, precision ...int) PathsD
- func XorWithClipPathsD(subject, clip PathsD, fillRule FillRule, precision ...int) PathsD
- type Point64
- type PointD
- type PointInPolygonResult
- type PolyPath64
- type PolyPathBase
- func (p *PolyPathBase) AddChild(pth Path64) *PolyPathBase
- func (p *PolyPathBase) Clear()
- func (p *PolyPathBase) Count() int
- func (p *PolyPathBase) GetChildren() []*PolyPathBase
- func (p *PolyPathBase) IsHole() bool
- func (p *PolyPathBase) Level() int
- func (p *PolyPathBase) Scale() float64
- func (p *PolyPathBase) SetScale(scale float64)
- func (p *PolyPathBase) ToString() string
- func (p *PolyPathBase) ToStringInternal(idx, level int) string
- type PolyPathD
- type PolyTree64
- type PolyTreeD
- type Rect64
- type RectClip64
- type RectClipLines64
- type RectD
- type UInt128Struct
- type Vertex
- type VertexFlags
- type VertexPoolList
Constants ¶
View Source
const ( ToEven = iota AwayFromZero )
View Source
const ( None VertexFlags = 0 OpenStart = 1 OpenEnd = 2 LocalMax = 4 LocalMin = 8 )
View Source
const ( MaxInt64 = int64(9223372036854775807) MaxCoord = MaxInt64 / 4 Invalid64 = MaxInt64 )
View Source
const (
Tolerance float64 = 1.0e-12
)
Variables ¶
View Source
var ( ErrPrecisionRange = errors.New("precision is out of range") ErrInvalidRemoveListIndex = errors.New("invalid remove index from list") )
Functions ¶
func AreaPaths64 ¶
func AreaPathsD ¶
func CrossProduct ¶
CrossProduct for three Point64 (pt1->pt2 x pt2->pt3)
func IsPositive64 ¶
func IsPositiveD ¶
func NewClipper64 ¶
func NewClipper64() *clipper64
func NewClipperD ¶
func NewClipperD(decimalPrecision int) *clipperD
func Path2ContainsPath1 ¶
func PointsNearEqual ¶
func ReversePath ¶ added in v1.0.1
func ReversePath[T any](p []T) []T
func SwapFrontBackSides ¶
func SwapFrontBackSides(outrec *OutRec)
Types ¶
type ClipperOffset ¶
type ClipperOffset struct {
ArcTolerance float64
MergeGroups bool
MiterLimit float64
PreserveCollinear bool
ReverseSolution bool
// contains filtered or unexported fields
}
func NewClipperOffset ¶
func NewClipperOffset(miterLimit, arcTolerance float64, preserveCollinear, reverseSolution bool) *ClipperOffset
func (*ClipperOffset) AddPaths ¶
func (co *ClipperOffset) AddPaths(paths Paths64, joinType JoinType, endType EndType)
func (*ClipperOffset) CalcSolutionCapacity ¶
func (co *ClipperOffset) CalcSolutionCapacity() int
func (*ClipperOffset) CheckPathsReversed ¶
func (co *ClipperOffset) CheckPathsReversed() bool
func (*ClipperOffset) Execute64 ¶
func (co *ClipperOffset) Execute64(delta float64, solution *Paths64)
func (*ClipperOffset) SetDeltaCallback ¶ added in v1.3.0
func (co *ClipperOffset) SetDeltaCallback(deltaCallback *DeltaCallbackFunc)
type DeltaCallbackFunc ¶ added in v1.3.0
type FillRule ¶
type FillRule uint8
FillRule specifies how to determine polygon interiors for self-intersecting polygons
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) GetLowestPathInfo ¶
type HorzJoin ¶
type HorzJoin struct {
// contains filtered or unexported fields
}
func NewHorzJoin ¶
type HorzSegment ¶
type HorzSegment struct {
// contains filtered or unexported fields
}
func NewHorzSegment ¶
func NewHorzSegment(op *OutPt) *HorzSegment
type InflateOption ¶ added in v1.2.1
type InflateOption func(*inflateConfig)
func WithArcTolerance ¶ added in v1.2.1
func WithArcTolerance(tolerance float64) InflateOption
func WithMitterLimit ¶ added in v1.2.1
func WithMitterLimit(limit float64) InflateOption
func WithPrecision ¶ added in v1.2.1
func WithPrecision(precision int) InflateOption
type IntersectNode ¶
type IntersectNode struct {
// contains filtered or unexported fields
}
func NewIntersectNode ¶
func NewIntersectNode(pt Point64, edge1 *Active, edge2 *Active) *IntersectNode
type LocalMinima ¶
func NewLocalMinima ¶
func NewLocalMinima(vertex *Vertex, polytype PathType, isOpen bool) *LocalMinima
func (*LocalMinima) Equals ¶
func (l *LocalMinima) Equals(r *LocalMinima) bool
type MidpointRounding ¶
type MidpointRounding uint8
type Path64 ¶
type Path64 []Point64
Path64 represents a sequence of points forming a path
func MakePath64 ¶ added in v1.0.1
func OffsetPath ¶
func PathDToPath64 ¶
func ScalePath64 ¶
func ScalePathDToPath64 ¶
func SimplifyPath64 ¶ added in v1.1.0
func StripDuplicates ¶
func TranslatePath64 ¶ added in v1.1.0
func TrimCollinear64 ¶ added in v1.1.0
type PathD ¶
type PathD []PointD
PathD represents a sequence of points forming a path
func Path64ToPathD ¶
func ScalePath64ToPathD ¶
func ScalePathD ¶
func SimplifyPathD ¶ added in v1.1.0
func TranslatePathD ¶ added in v1.1.0
type Paths64 ¶
type Paths64 []Path64
Paths64 represents a collection of paths
func BooleanOpPaths64 ¶
func InflatePaths64 ¶
func MinkowskiDiff64 ¶
func MinkowskiSum64 ¶
func PathsDToPaths64 ¶
func RectClipLinesPath64 ¶ added in v1.1.0
func RectClipLinesPaths64 ¶ added in v1.1.0
func RectClipPath64 ¶ added in v1.1.0
func RectClipPaths64 ¶ added in v1.1.0
func ScalePathsDToPaths64 ¶
func SimplifyPaths64 ¶ added in v1.1.0
func TranslatePaths64 ¶ added in v1.1.0
func UnionPaths64 ¶
func UnionWithClipPaths64 ¶
func XorWithClipPaths64 ¶
type PathsD ¶
type PathsD []PathD
PathsD represents a collection of paths
func BooleanOpPathsD ¶
func InflatePathsD ¶
func IntersectWithClipPathsD ¶
func MinkowskiDiffD ¶
func MinkowskiSumD ¶
func Paths64ToPathsD ¶
func RectClipLinesPathD ¶ added in v1.1.0
func RectClipLinesPathsD ¶ added in v1.1.0
func RectClipPathD ¶ added in v1.1.0
func RectClipPathsD ¶ added in v1.1.0
func ScalePaths64ToPathsD ¶
func SimplifyPathsD ¶ added in v1.1.0
func TranslatePathsD ¶ added in v1.1.0
func UnionWithClipPathsD ¶
type Point64 ¶
type Point64 struct {
X, Y int64
}
Point64 represents a point with 64-bit integer coordinates
func NewFloatPoint64 ¶
func (*Point64) ToPointDScale ¶
type PointInPolygonResult ¶
type PointInPolygonResult uint8
const ( IsOn PointInPolygonResult = iota IsInside IsOutside )
func PointInPolygon ¶ added in v1.1.0
func PointInPolygon(pt Point64, polygon Path64) PointInPolygonResult
type PolyPath64 ¶ added in v1.1.5
type PolyPath64 struct {
*PolyPathBase
}
type PolyPathBase ¶
type PolyPathBase struct {
// contains filtered or unexported fields
}
func NewPolyPathBase ¶
func NewPolyPathBase(parent *PolyPathBase) *PolyPathBase
func (*PolyPathBase) AddChild ¶
func (p *PolyPathBase) AddChild(pth Path64) *PolyPathBase
func (*PolyPathBase) Clear ¶
func (p *PolyPathBase) Clear()
func (*PolyPathBase) Count ¶ added in v1.1.5
func (p *PolyPathBase) Count() int
func (*PolyPathBase) GetChildren ¶
func (p *PolyPathBase) GetChildren() []*PolyPathBase
func (*PolyPathBase) IsHole ¶
func (p *PolyPathBase) IsHole() bool
func (*PolyPathBase) Level ¶
func (p *PolyPathBase) Level() int
func (*PolyPathBase) Scale ¶ added in v1.1.5
func (p *PolyPathBase) Scale() float64
func (*PolyPathBase) SetScale ¶ added in v1.1.5
func (p *PolyPathBase) SetScale(scale float64)
func (*PolyPathBase) ToString ¶ added in v1.1.5
func (p *PolyPathBase) ToString() string
func (*PolyPathBase) ToStringInternal ¶ added in v1.1.5
func (p *PolyPathBase) ToStringInternal(idx, level int) string
type PolyPathD ¶ added in v1.1.5
type PolyPathD struct {
*PolyPathBase
}
type PolyTree64 ¶ added in v1.1.5
type PolyTree64 PolyPath64
func BooleanOpPolyTree64 ¶ added in v1.2.0
func BooleanOpPolyTree64(clipType ClipType, subject Paths64, clip Paths64, fillRule FillRule) *PolyTree64
func NewPolyTree64 ¶ added in v1.1.5
func NewPolyTree64() *PolyTree64
type PolyTreeD ¶ added in v1.1.5
type PolyTreeD PolyPathD
func BooleanOpPolyTreeD ¶ added in v1.1.5
func NewPolyTreeD ¶ added in v1.1.5
func NewPolyTreeD() *PolyTreeD
type Rect64 ¶
type Rect64 struct {
// contains filtered or unexported fields
}
func GetBounds64 ¶
func NewRect64Invalid ¶
func ScaleRect64 ¶
func ScaleRectD ¶ added in v1.1.0
func (*Rect64) Intersects ¶
type RectClip64 ¶ added in v1.1.0
type RectClip64 struct {
// contains filtered or unexported fields
}
func NewRectClip64 ¶ added in v1.1.0
func NewRectClip64(rect Rect64, getPathV ...func(op *OutPt2) Path64) *RectClip64
func (*RectClip64) Execute ¶ added in v1.1.0
func (r *RectClip64) Execute(paths Paths64) Paths64
type RectClipLines64 ¶ added in v1.1.0
type RectClipLines64 struct {
*RectClip64
}
func NewRectClipLines64 ¶ added in v1.1.0
func NewRectClipLines64(rect Rect64) *RectClipLines64
type RectD ¶
type RectD struct {
// contains filtered or unexported fields
}
func NewRectDInvalid ¶
func (*RectD) Intersects ¶
type UInt128Struct ¶
type VertexFlags ¶
type VertexFlags uint8
type VertexPoolList ¶
type VertexPoolList []*Vertex
func (*VertexPoolList) Add ¶
func (vpl *VertexPoolList) Add(pt Point64, flags VertexFlags, prev *Vertex) *Vertex
func (*VertexPoolList) EnsureCapacity ¶
func (vpl *VertexPoolList) EnsureCapacity(nCap int)
Click to show internal directories.
Click to hide internal directories.