TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
tmk::analysis::detail::Region Class Reference

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ Region() [1/2]

tmk::analysis::detail::Region::Region ( )
default

◆ Region() [2/2]

tmk::analysis::detail::Region::Region ( const Rings & rings)
inlineexplicit

< a horizontal edge never crosses a horizontal ray

Definition at line 33 of file region.hpp.

Member Function Documentation

◆ contains()

bool tmk::analysis::detail::Region::contains ( Pt p) const
inline

Inside the region (on its boundary counts as inside: a return may run along it).

Definition at line 73 of file region.hpp.

◆ crosses()

bool tmk::analysis::detail::Region::crosses ( Pt a,
Pt b ) const
inline

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.

◆ crosses_linear()

bool tmk::analysis::detail::Region::crosses_linear ( Pt a,
Pt b ) const
inline

Definition at line 185 of file region.hpp.

◆ empty()

bool tmk::analysis::detail::Region::empty ( ) const
inline

Definition at line 70 of file region.hpp.

◆ island_of()

int tmk::analysis::detail::Region::island_of ( Pt p) const
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.

◆ island_of_linear()

int tmk::analysis::detail::Region::island_of_linear ( Pt p) const
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.

◆ nearest_boundary()

bool tmk::analysis::detail::Region::nearest_boundary ( Pt p,
double reach,
Pt & out ) const
inline

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.

◆ nearest_boundary_linear()

bool tmk::analysis::detail::Region::nearest_boundary_linear ( Pt p,
double reach,
Pt & out ) const
inline

Definition at line 190 of file region.hpp.

◆ sees()

bool tmk::analysis::detail::Region::sees ( Pt a,
Pt b ) const
inline

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.

◆ vertices_near()

void tmk::analysis::detail::Region::vertices_near ( Pt a,
Pt b,
double bound,
std::vector< Pt > & out ) const
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.

◆ vertices_near_linear()

std::size_t tmk::analysis::detail::Region::vertices_near_linear ( Pt a,
Pt b,
double bound ) const
inline

Definition at line 199 of file region.hpp.


The documentation for this class was generated from the following file: