Horizon
Loading...
Searching...
No Matches
surface_data.hpp
1#pragma once
2#include <string>
3#include <ostream>
4#include <type_traits>
5#include "attributes.hpp"
6#include <map>
7#include <vector>
8#include "common/common.hpp"
9#include "util/placement.hpp"
10
11namespace horizon {
12class Polygon;
13} // namespace horizon
14
15namespace horizon::ODB {
16
18public:
20 public:
21 enum class Direction { CW, CCW };
22 enum class Type { SEGMENT, ARC };
23
24 SurfaceLine(const Coordi &c) : end(c)
25 {
26 }
27 SurfaceLine(const Coordi &e, const Coordi &c, Direction d) : end(e), type(Type::ARC), center(c), direction(d)
28 {
29 }
30
31 Coordi end;
32 Type type = Type::SEGMENT;
33
34
35 Coordi center;
36 Direction direction;
37 };
38
39 void write(std::ostream &ost) const;
40
41 void append_polygon(const Polygon &poly, const Placement &transform = Placement());
42 void append_polygon_auto_orientation(const Polygon &poly, const Placement &transform = Placement());
43
44
45 // first one is contour (island) oriented clockwise
46 // remainder are holes oriented counter clockwise
47 std::vector<std::vector<SurfaceLine>> lines;
48};
49
50} // namespace horizon::ODB
Definition surface_data.hpp:19
Definition surface_data.hpp:17
Definition placement.hpp:8
Polygon used in Padstack, Package and Board for specifying filled Regions.
Definition polygon.hpp:25