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

Method Settle

path_intersection.go:130–132  ·  view source on GitHub ↗

Settle returns the "settled"/flattened path, a visually identical version of the original. 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

(fillRule FillRule)

Source from the content-addressed store, hash-verified

128// flat. It runs in O((n + k) log n), with n the number of segments, and k the number of
129// intersections.
130func (p *Path) Settle(fillRule FillRule) *Path {
131 return bentleyOttmann(p.Split(), nil, opSettle, fillRule).Merge()
132}
133
134// Settle is the same as Path.Settle, but faster if paths are already split. Each resulting path
135// is a single filling path followed by its holes as subpaths.

Callers 4

OffsetMethod · 0.95
StrokeMethod · 0.95
bentleyOttmannFunction · 0.45
TestPathSettleFunction · 0.45

Calls 3

SplitMethod · 0.95
bentleyOttmannFunction · 0.85
MergeMethod · 0.80

Tested by 1

TestPathSettleFunction · 0.36