def cover.oriented

gralha-svg-render@0.1.0.1 · svg.bend:4139

import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

4139# Every part polygon is oriented the same way so nonzero winding unions them.
4140def cover.oriented(pts: List<&2, Point>) -> List<&2, Point>:
4141  match pts:
4142    case Nil{}: Nil{}
4143    case Con{p, rest}:
4144      +pp = p
4145      +ps = {Con{pp, rest} : List<&2, Point>}
4146      U.branch(List<&2, Point>, F32.is_lt(cover.area(ps, pp, 0.0), 0.0), _ => cover.reverse(ps, Nil{}), _ => ps)

Uses (6)

Used by (0)

No other definition uses this definition.