sayoi7799/moon_rough/geometry does not have a README file

    Point

    pub(all) struct Point {
    x : Double
    y : Double
    } derive(
    Debug
    )

    A point, [x, y] in rough.js.

    Points are mutable and compared by identity on purpose: hachure-fill rotates the polygons it is given in place (and back), and later stages of rough.js read those slightly perturbed coordinates. Sharing and copying points exactly where the JavaScript code shares or copies its arrays keeps the results bit-identical.

    Point::copy

    fn Point::copy(self : Point) -> Point

    A new point with the same coordinates ([...p] / [p[0], p[1]]).

    Point::new

    fn Point::new(x : Double, y : Double) -> Point

    line_length

    fn line_length(p1 : Point, p2 : Point) -> Double

    lineLength([p1, p2]).

    Source Files