|
TraceMaker
C++ API of the engine
|
The reference copper of one layer: the region under the non-zero rule (islands with their holes). More...
#include <analysis/region.hpp>
Public Member Functions | |
| Region ()=default | |
| Region (const Rings &rings) | |
| bool | empty () const |
| bool | contains (Pt p) const |
| Inside the region (on its boundary counts as inside: a return may run along it). | |
| int | island_of (Pt p) const |
| Which island of copper (an outer ring with its holes) the point is on, -1 if none: two points on different islands have no path between them. | |
| void | vertices_near (Pt a, Pt b, double bound, std::vector< Pt > &out) const |
| The vertices a path no longer than bound between a and b could bend at: inside the ellipse with foci a and b. | |
| bool | crosses (Pt a, Pt b) const |
| Is the open segment a-b free of properly crossing edges? Touching an edge at a vertex or running along it is allowed. | |
| bool | sees (Pt a, Pt b) const |
| The segment lies in the region: no edge crosses it, and every piece of it between two touches of the boundary is inside (a segment that runs along the boundary and over a gap in it would pass a midpoint test). | |
| bool | nearest_boundary (Pt p, double reach, Pt &out) const |
| The point of the region's boundary nearest to p, within reach; false if none. | |
| int | island_of_linear (Pt p) const |
| Reference paths (project rule: every accelerated path has one): the same answers by scanning every edge and vertex. | |
| bool | crosses_linear (Pt a, Pt b) const |
| bool | nearest_boundary_linear (Pt p, double reach, Pt &out) const |
| std::size_t | vertices_near_linear (Pt a, Pt b, double bound) const |
The reference copper of one layer: the region under the non-zero rule (islands with their holes).
Its edges and vertices are bucketed in grids so that "is this point on copper?", "can a segment cross it?" and "which vertices are near?" cost the neighbourhood and not the whole pour (the plane of a large board has hundreds of thousands of edges, most of them antipads), and the vertices a shortest path can bend at.
Definition at line 30 of file region.hpp.
|
default |
|
inlineexplicit |
< a horizontal edge never crosses a horizontal ray
Definition at line 33 of file region.hpp.
|
inline |
Inside the region (on its boundary counts as inside: a return may run along it).
Definition at line 73 of file region.hpp.
Is the open segment a-b free of properly crossing edges? Touching an edge at a vertex or running along it is allowed.
Definition at line 91 of file region.hpp.
Definition at line 185 of file region.hpp.
|
inline |
Definition at line 70 of file region.hpp.
|
inline |
Which island of copper (an outer ring with its holes) the point is on, -1 if none: two points on different islands have no path between them.
Definition at line 75 of file region.hpp.
|
inline |
Reference paths (project rule: every accelerated path has one): the same answers by scanning every edge and vertex.
Only the tests call these.
Definition at line 170 of file region.hpp.
The point of the region's boundary nearest to p, within reach; false if none.
Cells are searched in growing squares. Several edges can be exactly as near (a pad at the centre of a round antipad): the one that comes first in the region's edge order wins, so the answer does not depend on the order the grid is walked in.
< the new ring of cells only
< nothing in a farther ring can be nearer
Definition at line 148 of file region.hpp.
|
inline |
Definition at line 190 of file region.hpp.
The segment lies in the region: no edge crosses it, and every piece of it between two touches of the boundary is inside (a segment that runs along the boundary and over a gap in it would pass a midpoint test).
< p on the segment (within 3 nm)? its parameter
< a piece shorter than 2 nm
Definition at line 107 of file region.hpp.
|
inline |
The vertices a path no longer than bound between a and b could bend at: inside the ellipse with foci a and b.
Definition at line 78 of file region.hpp.
|
inline |
Definition at line 199 of file region.hpp.