Horizon
hole.hpp
1 #pragma once
2 #include "util/uuid.hpp"
3 #include "common.hpp"
4 #include "nlohmann/json_fwd.hpp"
5 #include "polygon.hpp"
6 #include <vector>
7 #include <map>
8 #include <fstream>
9 #include "util/placement.hpp"
10 
11 
12 namespace horizon {
13 using json = nlohmann::json;
14 
18 class Hole {
19 public:
20  Hole(const UUID &uu, const json &j);
21  Hole(const UUID &uu);
22 
23  UUID uuid;
24  Placement placement;
25  uint64_t diameter = 0.5_mm;
26  uint64_t length = 0.5_mm;
27  std::string parameter_class;
28 
33  bool plated = false;
34 
35  enum class Shape { ROUND, SLOT };
36  Shape shape = Shape::ROUND;
37 
38  Polygon to_polygon() const;
39 
40 
41  UUID get_uuid() const;
42 
43  // not stored
44  json serialize() const;
45 };
46 } // namespace horizon
A hole with diameter and position, that's it.
Definition: hole.hpp:18
bool plated
true if this hole is PTH, false if NPTH.
Definition: hole.hpp:33
Definition: placement.hpp:8
Polygon used in Padstack, Package and Board for specifying filled Regions.
Definition: polygon.hpp:27
For commonly used Pad shapes.
Definition: shape.hpp:18
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
a class to store JSON values
Definition: json.hpp:166
zip_uint64_t uint64_t
zip_uint64_t_t typedef.
Definition: zip.hpp:108
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61