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

Method And

path_intersection.go:147–149  ·  view source on GitHub ↗

And returns the boolean path operation of path p AND q, i.e. the intersection of both. It removes all self-intersections and overlapping areas, orients all filling paths CCW and all holes CW, and tries to separate paths as much as possible. Paths are grouped by the filling/outer ring followed by the

(q *Path)

Source from the content-addressed store, hash-verified

145// flat. Path q is implicitly closed. It runs in O((n + k) log n), with n the number of segments,
146// and k the number of intersections.
147func (p *Path) And(q *Path) *Path {
148 return bentleyOttmann(p.Split(), q.Split(), opAND, NonZero).Merge()
149}
150
151// And is the same as Path.And, but faster if paths are already split. Each resulting path
152// is a single filling path followed by its holes as subpaths.

Callers 1

TileMethod · 0.95

Calls 3

SplitMethod · 0.95
bentleyOttmannFunction · 0.85
MergeMethod · 0.80

Tested by

no test coverage detected