aboutsummaryrefslogtreecommitdiff
path: root/src/critical_points.h
blob: b7e8cbbe7fc0294d70ea1c7ad79248f516a5c863 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef INCLUDED_CRITICAL_POINTS_H
#define INCLUDED_CRITICAL_POINTS_H

#include "path.h"
#include "vec2.h"

enum critical_point_type {
  CPT_IN,
  CPT_OUT,
  CPT_LOOP,
  CPT_BEG,
  CPT_END,
};

struct critical_point {
  enum critical_point_type type;

  struct path_element *left;
  struct path_element *right;

  struct vec2 s;
  struct vec2 r;
  struct vec2 t_left;
  struct vec2 t_right;
};

struct critical_points {
  struct critical_point *items;
  uint32_t count;
  uint32_t capacity;
};

struct critical_points find_critical_points (const struct path *);

#endif // INCLUDED_CRITICAL_POINTS_H