def outline.vertex.pick

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

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

1536# The points at vertex p between the previous segment (direction u, offset
1537# end a1) and the next (direction v, offset start b0).
1538def outline.vertex.pick(straight: Bool, outer: Bool, +p: Point, +u: Point, +a1: Point, +lenPrev: F32, +v: Point, +b0: Point, +lenNext: F32, +r: F32, +js: Joins, +scale: F32, acc: List<&2, Point>) -> List<&2, Point>:
1539  match straight:
1540    case True{}: Con{b0, outline.back.if(F32.is_lt(point.dot(u, v), 0.0), p, u, r, js, scale, Con{a1, acc})}
1541    case False{}:
1542      match outer:
1543        case True{}: Con{b0, outline.join.outer(p, u, v, r, js, scale, Con{a1, acc})}
1544        case False{}: outline.inner(p, u, a1, lenPrev, v, b0, lenNext, acc)

Uses (10)

Used by (1)