MCPcopy Index your code
hub / github.com/tdewolff/canvas / Div

Method Div

path_intersection.go:215–217  ·  view source on GitHub ↗

Div returns the boolean path operation of path p DIV q, i.e. p divided by q. 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 correspon

(q *Path)

Source from the content-addressed store, hash-verified

213// flat. Path q is implicitly closed. It runs in O((n + k) log n), with n the number of segments,
214// and k the number of intersections.
215func (p *Path) Div(q *Path) *Path {
216 return bentleyOttmann(p.Split(), q.Split(), opDIV, NonZero).Merge()
217}
218
219// Div is the same as Path.DivideBy, but faster if paths are already split. Each resulting
220// path is a single filling path followed by its holes as subpaths.

Callers

nothing calls this directly

Calls 3

SplitMethod · 0.95
bentleyOttmannFunction · 0.85
MergeMethod · 0.80

Tested by

no test coverage detected