def outline.miter

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

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

1483def outline.miter(+p: Point, +a: Point, +b: Point, +u: Point, +v: Point, +r: F32, +limit: F32, +join: U32, acc: List<&2, Point>) -> List<&2, Point>:
1484  +m = point.add(a, point.scale(u, (point.cross(point.sub(b, a), v) / point.cross(u, v) : F32)))
1485  +distance = point.distance(p, m)
1486  +n = point.unit(point.sub(m, p))
1487  +reach = (limit * r : F32)
1488  outline.miter.pick(F32.is_le(distance, reach), U32.is_eq(join, 3), m, a, b, point.dot(point.sub(a, p), n), point.dot(point.sub(b, p), n), distance, reach, acc)

Uses (16)

Used by (1)