Horizon
Loading...
Searching...
No Matches
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 "util/placement.hpp"
7
8
9namespace horizon {
10using json = nlohmann::json;
11
15class Hole {
16public:
17 Hole(const UUID &uu, const json &j);
18 Hole(const UUID &uu);
19
20 UUID uuid;
21 Placement placement;
22 uint64_t diameter = 0.5_mm;
23 uint64_t length = 0.5_mm;
24 std::string parameter_class;
25
30 bool plated = false;
31
32 enum class Shape { ROUND, SLOT };
33 Shape shape = Shape::ROUND;
34
35 LayerRange span;
36
37 Polygon to_polygon() const;
38 std::pair<Coordi, Coordi> get_bbox() const;
39
40 UUID get_uuid() const;
41
42 // not stored
43 json serialize() const;
44};
45} // namespace horizon
A hole with diameter and position, that's it.
Definition hole.hpp:15
bool plated
true if this hole is PTH, false if NPTH.
Definition hole.hpp:30
Definition layer_range.hpp:11
Definition placement.hpp:8
Polygon used in Padstack, Package and Board for specifying filled Regions.
Definition polygon.hpp:25
For commonly used Pad shapes.
Definition shape.hpp:15
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:177
basic_json<> json
default JSON class
Definition json_fwd.hpp:62