goclipper2

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clipper64

type Clipper64 struct {
	// contains filtered or unexported fields
}

func NewClipper64

func NewClipper64() *Clipper64

func (*Clipper64) AddClip

func (c *Clipper64) AddClip(clips Paths64)

func (*Clipper64) AddOpenSubject

func (c *Clipper64) AddOpenSubject(open_subjects Paths64)

func (*Clipper64) AddSubject

func (c *Clipper64) AddSubject(subjects Paths64)

func (*Clipper64) Clear

func (c *Clipper64) Clear()

func (*Clipper64) Delete

func (p *Clipper64) Delete()

func (*Clipper64) Destruct

func (p *Clipper64) Destruct()

func (*Clipper64) Execute

func (c64 *Clipper64) Execute(ct ClipperClipType, fr ClipperFillRule, closed Paths64, open Paths64) int64

func (*Clipper64) ExecuteTree

func (c64 *Clipper64) ExecuteTree(ct ClipperClipType, fr ClipperFillRule, tree PolyTree64) int64

func (*Clipper64) ExecuteTreeWithOpen

func (c64 *Clipper64) ExecuteTreeWithOpen(ct ClipperClipType, fr ClipperFillRule, tree PolyTree64, open Paths64) int64

func (*Clipper64) GetPreserveCollinear

func (c *Clipper64) GetPreserveCollinear() int64

func (*Clipper64) GetReverseSolution

func (c *Clipper64) GetReverseSolution() int64

func (*Clipper64) SetPreserveCollinear

func (c *Clipper64) SetPreserveCollinear(t int64)

func (*Clipper64) SetReverseSolution

func (c *Clipper64) SetReverseSolution(t int64)

type ClipperClipType

type ClipperClipType int
const (
	None         ClipperClipType = 0
	Intersection ClipperClipType = 1
	Union        ClipperClipType = 2
	Difference   ClipperClipType = 3
	XOR          ClipperClipType = 4
)

type ClipperD

type ClipperD struct {
	// contains filtered or unexported fields
}

func NewClipperd

func NewClipperd(precision int64) *ClipperD

func (*ClipperD) AddClip

func (c *ClipperD) AddClip(clips PathsD)

func (*ClipperD) AddOpenSubject

func (c *ClipperD) AddOpenSubject(open_subjects PathsD)

func (*ClipperD) AddSubject

func (c *ClipperD) AddSubject(subjects PathsD)

func (*ClipperD) Clear

func (c *ClipperD) Clear()

func (*ClipperD) Delete

func (p *ClipperD) Delete()

func (*ClipperD) Destruct

func (p *ClipperD) Destruct()

func (*ClipperD) Execute

func (cD *ClipperD) Execute(ct ClipperClipType, fr ClipperFillRule, closed PathsD, open PathsD) int64

func (*ClipperD) ExecuteTree

func (cD *ClipperD) ExecuteTree(ct ClipperClipType, fr ClipperFillRule, tree PolyTreeD) int64

func (*ClipperD) ExecuteTreeWithOpen

func (cD *ClipperD) ExecuteTreeWithOpen(ct ClipperClipType, fr ClipperFillRule, tree PolyTreeD, open PathsD) int64

func (*ClipperD) GetPreserveCollinear

func (c *ClipperD) GetPreserveCollinear() int64

func (*ClipperD) GetReverseSolution

func (c *ClipperD) GetReverseSolution() int64

func (*ClipperD) SetPreserveCollinear

func (c *ClipperD) SetPreserveCollinear(t int64)

func (*ClipperD) SetReverseSolution

func (c *ClipperD) SetReverseSolution(t int64)

type ClipperEndType

type ClipperEndType int
const (
	PolygonEnd ClipperEndType = 0
	JoinedEnd  ClipperEndType = 1
	ButtEnd    ClipperEndType = 2
	SquareEnd  ClipperEndType = 3
	RoundEnd   ClipperEndType = 4
)

type ClipperFillRule

type ClipperFillRule int
const (
	EvenOdd  ClipperFillRule = 0
	NonZero  ClipperFillRule = 1
	Positive ClipperFillRule = 2
	Negative ClipperFillRule = 3
)

type ClipperJoinType

type ClipperJoinType int
const (
	SquareJoin ClipperJoinType = 0
	RoundJoin  ClipperJoinType = 1
	MiterJoin  ClipperJoinType = 2
)

type ClipperOffset

type ClipperOffset struct {
	// contains filtered or unexported fields
}

func NewClipperoffset

func NewClipperoffset(miter_limit float64, arc_tolerance float64, preserve_collinear int64, reverse_solution int64) *ClipperOffset

func (*ClipperOffset) AddPath64

func (c *ClipperOffset) AddPath64(p Path64, jt ClipperJoinType, et ClipperEndType)

func (*ClipperOffset) AddPaths64

func (c *ClipperOffset) AddPaths64(p Paths64, jt ClipperJoinType, et ClipperEndType)

func (*ClipperOffset) Clear

func (c *ClipperOffset) Clear()

func (*ClipperOffset) Delete

func (p *ClipperOffset) Delete()

func (*ClipperOffset) Destruct

func (p *ClipperOffset) Destruct()

func (*ClipperOffset) ErrorCode

func (c *ClipperOffset) ErrorCode() int64

func (*ClipperOffset) Execute

func (c *ClipperOffset) Execute(delta float64) *Paths64

func (*ClipperOffset) ExecuteCallback added in v0.0.8

func (co *ClipperOffset) ExecuteCallback(cb ClipperOffsetCallback) *Paths64

func (*ClipperOffset) GetArcTolerance

func (c *ClipperOffset) GetArcTolerance() float64

func (*ClipperOffset) GetMiterLimit

func (c *ClipperOffset) GetMiterLimit() float64

func (*ClipperOffset) GetPreserveCollinear

func (c *ClipperOffset) GetPreserveCollinear() int64

func (*ClipperOffset) GetReverseSolution

func (c *ClipperOffset) GetReverseSolution() int64

func (*ClipperOffset) SetArcTolerance

func (c *ClipperOffset) SetArcTolerance(t float64)

func (*ClipperOffset) SetMiterLimit

func (c *ClipperOffset) SetMiterLimit(l float64)

func (*ClipperOffset) SetPreserveCollinear

func (c *ClipperOffset) SetPreserveCollinear(t int64)

func (*ClipperOffset) SetReverseSolution

func (c *ClipperOffset) SetReverseSolution(t int64)

type ClipperOffsetCallback added in v0.0.8

type ClipperOffsetCallback func(
	path *Path64,
	path_normals *PathD,
	curr_idx int,
	prev_idx int,
) float64

type ClipperPathType

type ClipperPathType int
const (
	Subject ClipperPathType = 0
	Clip    ClipperPathType = 1
)

type ClipperPointInPolygonResult

type ClipperPointInPolygonResult int

type Path64

type Path64 struct {
	// contains filtered or unexported fields
}

func NewPath64

func NewPath64() *Path64

func NewPath64Ellipse

func NewPath64Ellipse(center Point64, radius_x float64, radius_y float64, steps int64) *Path64

func NewPath64MustOfString

func NewPath64MustOfString(str string) *Path64

func NewPath64OfPoints

func NewPath64OfPoints(pts []Point64) *Path64

func NewPath64OfString

func NewPath64OfString(str string) (*Path64, error)

func (*Path64) AddPoint

func (path *Path64) AddPoint(pt Point64)

func (*Path64) Area

func (path *Path64) Area() float64

func (*Path64) Delete

func (p *Path64) Delete()

func (*Path64) Destruct

func (p *Path64) Destruct()

func (*Path64) GetPoint

func (path *Path64) GetPoint(idx int64) Point64

func (*Path64) IsPositive

func (path *Path64) IsPositive() int64

func (*Path64) Length

func (path *Path64) Length() int64

func (*Path64) MinkowskiDiff

func (pattern *Path64) MinkowskiDiff(path Path64, is_closed int64) *Paths64

func (*Path64) MinkowskiSum

func (pattern *Path64) MinkowskiSum(path Path64, is_closed int64) *Paths64

func (*Path64) RamerDouglasPeucker

func (path *Path64) RamerDouglasPeucker(epsilon float64) *Path64

func (*Path64) Scale

func (path *Path64) Scale(sx float64, sy float64) (*Path64, int)

func (*Path64) ScaleToPathD

func (p *Path64) ScaleToPathD(sx, sy float64) (*PathD, int)

func (*Path64) Simplify

func (path *Path64) Simplify(epsilon float64, is_open_path int64) *Path64

func (*Path64) String

func (p *Path64) String() string

func (*Path64) StripNearEqual

func (path *Path64) StripNearEqual(max_dist_sqrd float64, is_closed_path int64) *Path64

func (*Path64) ToPathd

func (path *Path64) ToPathd() *PathD

func (*Path64) ToPoints

func (path *Path64) ToPoints() []Point64

func (*Path64) Translate

func (path *Path64) Translate(dx int64, dy int64) *Path64

func (*Path64) TrimCollinear

func (path *Path64) TrimCollinear(is_open_path int64) *Path64

type PathD

type PathD struct {
	// contains filtered or unexported fields
}

func NewPathDOfPoints

func NewPathDOfPoints(pts []PointD) *PathD

func NewPathd

func NewPathd() *PathD

func NewPathdEllipse

func NewPathdEllipse(center PointD, radius_x float64, radius_y float64, steps int64) *PathD

func (*PathD) AddPoint

func (path *PathD) AddPoint(pt PointD)

func (*PathD) Area

func (path *PathD) Area() float64

func (*PathD) Delete

func (p *PathD) Delete()

func (*PathD) Destruct

func (p *PathD) Destruct()

func (*PathD) GetPoint

func (path *PathD) GetPoint(idx int64) PointD

func (*PathD) IsPositive

func (path *PathD) IsPositive() int64

func (*PathD) Length

func (path *PathD) Length() int64

func (*PathD) MinkowskiDiff

func (pattern *PathD) MinkowskiDiff(path PathD, is_closed int64, precision int64) *PathsD

func (*PathD) MinkowskiSum

func (pattern *PathD) MinkowskiSum(path PathD, is_closed int64, precision int64) *PathsD

func (*PathD) RamerDouglasPeucker

func (path *PathD) RamerDouglasPeucker(epsilon float64) *PathD

func (*PathD) Scale

func (path *PathD) Scale(sx float64, sy float64) (*PathD, int)

func (*PathD) ScaleToPath64

func (p *PathD) ScaleToPath64(sx, sy float64) (*Path64, int)

func (*PathD) Simplify

func (path *PathD) Simplify(epsilon float64, is_open_path int64) *PathD

func (*PathD) StripNearEqual

func (path *PathD) StripNearEqual(max_dist_sqrd float64, is_closed_path int64) *PathD

func (*PathD) ToPath64

func (path *PathD) ToPath64() *Path64

func (*PathD) ToPoints

func (path *PathD) ToPoints() []PointD

func (*PathD) Translate

func (path *PathD) Translate(dx float64, dy float64) *PathD

func (*PathD) TrimCollinear

func (path *PathD) TrimCollinear(precision int64, is_open_path int64) *PathD

type Paths64

type Paths64 struct {
	// contains filtered or unexported fields
}

func NewPaths64

func NewPaths64() *Paths64

func NewPaths64OfPaths

func NewPaths64OfPaths(pths []Path64) *Paths64

func (*Paths64) AddPath

func (paths *Paths64) AddPath(p Path64)

func (*Paths64) Area

func (paths *Paths64) Area() float64

func (*Paths64) BooleanOp

func (subjects *Paths64) BooleanOp(clipType ClipperClipType, fillRule ClipperFillRule, clips *Paths64) *Paths64

func (*Paths64) BooleanOpTree

func (subjects *Paths64) BooleanOpTree(clipType ClipperClipType, fillRule ClipperFillRule, clips *Paths64) *PolyTree64

func (*Paths64) Bounds

func (paths *Paths64) Bounds() *Rect64

func (*Paths64) Delete

func (p *Paths64) Delete()

func (*Paths64) Destruct

func (p *Paths64) Destruct()

func (*Paths64) Difference

func (subjects *Paths64) Difference(clips Paths64, fillrule ClipperFillRule) *Paths64

func (*Paths64) GetPath

func (paths *Paths64) GetPath(idx int64) *Path64

func (*Paths64) GetPoint

func (paths *Paths64) GetPoint(path_idx int64, point_idx int64) Point64

func (*Paths64) Inflate

func (paths *Paths64) Inflate(delta float64, jt ClipperJoinType, et ClipperEndType, miter_limit float64) *Paths64

func (*Paths64) Intersect

func (subjects *Paths64) Intersect(clips Paths64, fillrule ClipperFillRule) *Paths64

func (*Paths64) Length

func (paths *Paths64) Length() int64

func (*Paths64) Lengths

func (paths *Paths64) Lengths() []int64

func (*Paths64) PathLength

func (paths *Paths64) PathLength(idx int64) int64

func (*Paths64) RamerDouglasPeucker

func (paths *Paths64) RamerDouglasPeucker(epsilon float64) *Paths64

func (*Paths64) Scale

func (path *Paths64) Scale(sx float64, sy float64) (*Paths64, int)

func (*Paths64) ScaleToPathsD

func (p *Paths64) ScaleToPathsD(sx, sy float64) (*PathsD, int)

func (*Paths64) Simplify

func (paths *Paths64) Simplify(epsilon float64, is_open_paths int64) *Paths64

func (*Paths64) String

func (p *Paths64) String() string

func (*Paths64) StripNearEqual

func (paths *Paths64) StripNearEqual(max_dist_sqrd float64, is_closed_paths int64) *Paths64

func (*Paths64) ToPathsd

func (paths *Paths64) ToPathsd() *PathsD

func (*Paths64) ToPoints

func (p *Paths64) ToPoints() [][]Point64

func (*Paths64) Translate

func (paths *Paths64) Translate(dx int64, dy int64) *Paths64

func (*Paths64) Union

func (subjects *Paths64) Union(clips Paths64, fillrule ClipperFillRule) *Paths64

func (*Paths64) Xor

func (subjects *Paths64) Xor(clips Paths64, fillrule ClipperFillRule) *Paths64

type PathsD

type PathsD struct {
	// contains filtered or unexported fields
}

func NewPathsd

func NewPathsd() *PathsD

func NewPathsdOfPaths

func NewPathsdOfPaths(pths []PathD) *PathsD

func (*PathsD) AddPath

func (paths *PathsD) AddPath(p PathD)

func (*PathsD) Area

func (paths *PathsD) Area() float64

func (*PathsD) BooleanOp

func (subjects *PathsD) BooleanOp(clipType ClipperClipType, fillRule ClipperFillRule, clips *PathsD, decimalPrec int) *PathsD

func (*PathsD) BooleanOpTree

func (subjects *PathsD) BooleanOpTree(clipType ClipperClipType, fillRule ClipperFillRule, clips *PathsD, decimalPrec int) *PolyTreeD

func (*PathsD) Delete

func (p *PathsD) Delete()

func (*PathsD) Destruct

func (p *PathsD) Destruct()

func (*PathsD) Difference

func (subjects *PathsD) Difference(clips PathsD, fillrule ClipperFillRule, decimal_prec int64) *PathsD

func (*PathsD) GetPath

func (paths *PathsD) GetPath(idx int64) *PathD

func (*PathsD) GetPoint

func (paths *PathsD) GetPoint(path_idx int64, point_idx int64) PointD

func (*PathsD) Inflate

func (paths *PathsD) Inflate(delta float64, jt ClipperJoinType, et ClipperEndType, miter_limit float64, precision int64) *PathsD

func (*PathsD) Intersect

func (subjects *PathsD) Intersect(clips PathsD, fillrule ClipperFillRule, decimal_prec int64) *PathsD

func (*PathsD) Length

func (paths *PathsD) Length() int64

func (*PathsD) Lengths

func (paths *PathsD) Lengths() []int64

func (*PathsD) PathLength

func (paths *PathsD) PathLength(idx int64) int64

func (*PathsD) RamerDouglasPeucker

func (paths *PathsD) RamerDouglasPeucker(epsilon float64) *PathsD

func (*PathsD) Scale

func (path *PathsD) Scale(sx float64, sy float64) (*PathsD, int)

func (*PathsD) ScaleToPaths64

func (p *PathsD) ScaleToPaths64(sx, sy float64) (*Paths64, int)

func (*PathsD) Simplify

func (paths *PathsD) Simplify(epsilon float64, is_open_paths int64) *PathsD

func (*PathsD) StripNearEqual

func (paths *PathsD) StripNearEqual(max_dist_sqrd float64, is_closed_paths int64) *PathsD

func (*PathsD) ToPaths64

func (paths *PathsD) ToPaths64() *Paths64

func (*PathsD) ToPoints

func (p *PathsD) ToPoints() [][]PointD

func (*PathsD) Translate

func (paths *PathsD) Translate(dx float64, dy float64) *PathsD

func (*PathsD) Union

func (subjects *PathsD) Union(clips PathsD, fillrule ClipperFillRule, decimal_prec int64) *PathsD

func (*PathsD) Xor

func (subjects *PathsD) Xor(clips PathsD, fillrule ClipperFillRule, decimal_prec int64) *PathsD

type Point64

type Point64 struct {
	// contains filtered or unexported fields
}

func NewPoint64

func NewPoint64(x, y int64) *Point64

func (*Point64) Distance

func (a *Point64) Distance(b Point64) float64

func (*Point64) InPath64

func (p *Point64) InPath64(path *Path64) ClipperPointInPolygonResult

func (*Point64) NearCollinear

func (a *Point64) NearCollinear(b Point64, c Point64, sin_sqrd_min_angle_rads float64) int64

func (*Point64) String

func (p *Point64) String() string

func (*Point64) X added in v0.0.2

func (p *Point64) X() int64

func (*Point64) Y added in v0.0.2

func (p *Point64) Y() int64

type PointD

type PointD struct {
	// contains filtered or unexported fields
}

func NewPointD

func NewPointD(x, y float64) *PointD

func (*PointD) Distance

func (a *PointD) Distance(b PointD) float64

func (*PointD) InPath64

func (p *PointD) InPath64(path *PathD) ClipperPointInPolygonResult

func (*PointD) NearCollinear

func (a *PointD) NearCollinear(b PointD, c PointD, sin_sqrd_min_angle_rads float64) int64

func (*PointD) String added in v0.0.2

func (p *PointD) String() string

func (*PointD) X added in v0.0.2

func (p *PointD) X() float64

func (*PointD) Y added in v0.0.2

func (p *PointD) Y() float64

type PolyTree64

type PolyTree64 struct {
	// contains filtered or unexported fields
}

func NewPolytree64

func NewPolytree64(parent PolyTree64) *PolyTree64

func (*PolyTree64) AddChild

func (pt *PolyTree64) AddChild(path Path64) *PolyTree64

func (*PolyTree64) Area

func (pt *PolyTree64) Area() float64

func (*PolyTree64) Clear

func (pt *PolyTree64) Clear()

func (*PolyTree64) Count

func (pt *PolyTree64) Count() int64

func (*PolyTree64) Delete

func (p *PolyTree64) Delete()

func (*PolyTree64) Destruct

func (p *PolyTree64) Destruct()

func (*PolyTree64) FullyContainsChildren

func (pt *PolyTree64) FullyContainsChildren() int64

func (*PolyTree64) GetChild

func (pt *PolyTree64) GetChild(idx int64) *PolyTree64

func (*PolyTree64) IsHole

func (pt *PolyTree64) IsHole() int64

func (*PolyTree64) Level

func (pt *PolyTree64) Level() int64

func (*PolyTree64) Parent

func (pt *PolyTree64) Parent() *PolyTree64

func (*PolyTree64) Polygon

func (pt *PolyTree64) Polygon() *Path64

func (*PolyTree64) ToPaths

func (pt *PolyTree64) ToPaths() *Paths64

type PolyTreeD

type PolyTreeD struct {
	// contains filtered or unexported fields
}

func NewPolytreed

func NewPolytreed(parent PolyTreeD) *PolyTreeD

func (*PolyTreeD) AddChild

func (pt *PolyTreeD) AddChild(path Path64) *PolyTreeD

func (*PolyTreeD) Area

func (pt *PolyTreeD) Area() float64

func (*PolyTreeD) Clear

func (pt *PolyTreeD) Clear()

func (*PolyTreeD) Count

func (pt *PolyTreeD) Count() int64

func (*PolyTreeD) Delete

func (p *PolyTreeD) Delete()

func (*PolyTreeD) Destruct

func (p *PolyTreeD) Destruct()

func (*PolyTreeD) GetChild

func (pt *PolyTreeD) GetChild(idx int64) *PolyTreeD

func (*PolyTreeD) IsHole

func (pt *PolyTreeD) IsHole() int64

func (*PolyTreeD) Level

func (pt *PolyTreeD) Level() int64

func (*PolyTreeD) Parent

func (pt *PolyTreeD) Parent() *PolyTreeD

func (*PolyTreeD) Polygon

func (pt *PolyTreeD) Polygon() *PathD

func (*PolyTreeD) ToPaths

func (pt *PolyTreeD) ToPaths() *PathsD

type Rect64

type Rect64 struct {
	// contains filtered or unexported fields
}

func NewRect64

func NewRect64(left int64, top int64, right int64, bottom int64) *Rect64

func (*Rect64) AsPath

func (r *Rect64) AsPath() *Path64

func (*Rect64) ContainsPt

func (r *Rect64) ContainsPt(pt Point64) int64

func (*Rect64) ContainsRect

func (a *Rect64) ContainsRect(b Rect64) int64

func (*Rect64) Delete

func (p *Rect64) Delete()

func (*Rect64) Destruct

func (p *Rect64) Destruct()

func (*Rect64) Height

func (r *Rect64) Height() int64

func (*Rect64) Intersects

func (a *Rect64) Intersects(b Rect64) int64

func (*Rect64) IsEmpty

func (r *Rect64) IsEmpty() int64

func (*Rect64) Midpoint

func (r *Rect64) Midpoint() Point64

func (*Rect64) Scale

func (r *Rect64) Scale(scale float64) *Rect64

func (*Rect64) ScaleMut

func (r *Rect64) ScaleMut(scale float64)

func (*Rect64) ToStruct

func (rect *Rect64) ToStruct() Rect64

func (*Rect64) Width

func (r *Rect64) Width() int64

Jump to

Keyboard shortcuts

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