1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
7pub struct Point {
8 pub x: f64,
9 pub y: f64,
10}
11
12impl Point {
13 pub fn new(x: f64, y: f64) -> Self {
14 Self { x, y }
15 }
16}
17
18#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
20pub enum Instruction {
21 MoveTo { x: f64, y: f64 },
23 LineTo { x: f64, y: f64 },
25 CubicCurveTo {
27 x1: f64,
28 y1: f64,
29 x2: f64,
30 y2: f64,
31 x: f64,
32 y: f64,
33 },
34 QuadCurveTo { x1: f64, y1: f64, x: f64, y: f64 },
36 ClosePath,
38}
39
40#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
42pub struct EvolvedPath {
43 pub stroke_dasharray: String,
45 pub stroke_dashoffset: f64,
47}