... | @@ -78,3 +78,52 @@ The Geometry library incorporates the 3 parts: |
... | @@ -78,3 +78,52 @@ The Geometry library incorporates the 3 parts: |
|
- shape groups (a set of shapes treated as a single solid shape) and
|
|
- shape groups (a set of shapes treated as a single solid shape) and
|
|
indexes.
|
|
indexes.
|
|
|
|
|
|
|
|
### Basic classes
|
|
|
|
|
|
|
|
- **template<typename T> VECTOR2**
|
|
|
|
Numerically stable (explicit specialization for T == int to avoid
|
|
|
|
overflow on multiplication) 2D vector class.
|
|
|
|
Provides standard vector arithmentic, product, and distance
|
|
|
|
operators. Replacement of all wxPoints in the code that is not
|
|
|
|
related to the GUI.
|
|
|
|
- **template<class Vec> class BOX2**
|
|
|
|
Bounding box class, based on EDA\_RECT. Intended to replace
|
|
|
|
EDA\_RECT, GAL's BOUNDING\_BOX and wxRects in the parts of code that
|
|
|
|
are not UI-specific.
|
|
|
|
- **class ANGLE**, implementing a restricted set of angles. Provides
|
|
|
|
accurate point rotation
|
|
|
|
and vector-\>magnitude operators (in certain cases, without floating
|
|
|
|
point trigonometry and rounding errors
|
|
|
|
associated with it). For example an ANGLE45 class could be derived
|
|
|
|
from ANGLE and provide float-less (n \* 45 degree) directions for
|
|
|
|
all other geometry operations.
|
|
|
|
- **template<class Vec> class SEG**
|
|
|
|
Class defining a line segment. Provides segment/line intersection,
|
|
|
|
point-to-segment and segment-to-segment operators.
|
|
|
|
|
|
|
|
### Supported shapes
|
|
|
|
|
|
|
|
Shapes mandatory for the P\&S router:
|
|
|
|
|
|
|
|
- **class SHAPE** : abstract interface for all **SHAPE\_** classes.
|
|
|
|
- **class SHAPE\_RECT**: axis-aligned rectangle
|
|
|
|
- **class SHAPE\_ORIENTED\_RECT**: rectangle with rotation
|
|
|
|
- **class SHAPE\_CIRCLE**: full circle
|
|
|
|
- **class SHAPE\_LINE\_STRING**: string of line segments (a polyline)
|
|
|
|
|
|
|
|
More complex shapes (for DRC)
|
|
|
|
|
|
|
|
- **class SHAPE\_POLYGON**: polygon with holes. Cleaned-up version of
|
|
|
|
CPolyLine.
|
|
|
|
- **class SHAPE\_ARC**: circular arc
|
|
|
|
- \*class SHAPE\_BEZIER: quadratic bezier curve.
|
|
|
|
|
|
|
|
### Shape groups and indexes
|
|
|
|
|
|
|
|
- class SHAPE\_GROUP: group of shapes, behaving as a single body. Each
|
|
|
|
shape can have an individual offset (a vector) wrs to the group
|
|
|
|
origin.
|
|
|
|
- class SHAPE\_INDEX: class for spatial indexing of shapes. Internally
|
|
|
|
implements an R/R\*/Bounding Volume/Bounding Interval Tree. Provides
|
|
|
|
fast distance/collision query operator.
|
|
|
|
|