2 #include "common/common.hpp"
3 #include "nlohmann/json_fwd.hpp"
10 Placement(
const Coordi &sh = {0, 0},
int a = 0,
bool m =
false) : shift(sh), mirror(m), angle(a)
29 else if (angle == 32768) {
33 else if (angle == 49152) {
38 double af = (angle / 65536.0) * 2 * M_PI;
39 r.x = c.x * cos(af) - c.y * sin(af);
40 r.y = c.x * sin(af) + c.y * cos(af);
52 int64_t xa = std::min(bb.first.x, bb.second.x);
53 int64_t xb = std::max(bb.first.x, bb.second.x);
54 int64_t ya = std::min(bb.first.y, bb.second.y);
55 int64_t yb = std::max(bb.first.y, bb.second.y);
57 auto a = transform(
Coord<T>(xa, ya));
58 auto b = transform(
Coord<T>(xa, yb));
59 auto c = transform(
Coord<T>(xb, ya));
60 auto d = transform(
Coord<T>(xb, yb));
69 shift = {0, 0}, angle = 0, mirror =
false;
73 void set_angle(
int a);
74 void inc_angle(
int a);
75 void inc_angle_deg(
int a);
76 void set_angle_deg(
int a);
77 int get_angle()
const;
78 int get_angle_deg()
const;
82 json serialize()
const;