15 const Point_25& getPoint(uint i)
const {
return mPoints.at(i); }
16 const std::vector<Point_25>& getPoints()
const {
return mPoints; }
17 void setPoint(uint i,
const Point_25 &v) { mPoints.at(i) = v; }
19 const Point_25& front()
const {
return mPoints.front(); }
20 const Point_25& back()
const {
return mPoints.back(); }
21 const Point_25& back(uint n)
const { assert(mPoints.size() >= n);
return mPoints[mPoints.size() - n]; }
24 bool isPlanarAt(uint i)
const;
25 Segment_2 getSegmentAt(uint i)
const;
27 uint numPoints()
const {
return mPoints.size(); }
28 bool empty()
const {
return mPoints.empty(); }
29 uint numLayerChanges()
const {
return mNumLayerChanges; }
32 Real
length()
const {
return mLength; }
34 Real
RMSD()
const {
return mRMSD; }
36 float winding()
const {
return mWinding; }
37 float turning()
const {
return mTurning; }
40 Bbox_2 bbox(
int z)
const;
45 void setPoints(
const std::vector<Point_25>&, uint start, uint size);
52 void append(
const Path&);
54 uint removeUnnecessaryPoints();
59 void computeWinding();
61 bool compare(
const Path&)
const;
63 Real squared_distance(
const Point_25&, Real dz = std::numeric_limits<Real>::infinity())
const;
64 Real squared_distance(
const Pin&)
const;
65 bool intersects(
const Path&)
const;
66 bool violatesClearance(
const Path&, Real clearance)
const;
67 bool violatesClearance(
const Via&, Real clearance)
const;
68 uint countIntersections(
const Path&)
const;
70 std::string str()
const;
71 PyObject *getIntegerPointsPy(Real scaleXY)
const;
72 PyObject *getPointsNumpy()
const;
74 std::vector<Point_25> mPoints;
75 uint mNumLayerChanges{0};
82inline void Path::clear()
88inline void Path::resizeTo1()
95inline bool Path::isPlanarAt(uint i)
const
97 assert(i > 0 && i < mPoints.size());
98 return mPoints[i].z() == mPoints[i-1].z();
100inline Segment_2 Path::getSegmentAt(uint i)
const
102 assert(isPlanarAt(i));
103 return Segment_2(mPoints[i-1].xy(), mPoints[i].xy());
109 const auto v = mPoints.back();
void extendTo(const Point_25 &)
Adds the new point; replaces the last point if the new one continues the segment formed by the last t...
Real length() const
Length of the path (assumes it is contiguous).
Definition Path.hpp:32
void setPoints(const std::vector< Point_25 > &, uint start, uint size)
All modification functions except reverse() invalidate the statistics.
float winding() const
The winding number is the sum of the angles between the segments (0 for an Z, 90 for an L,...
Definition Path.hpp:36
void _add(const Point_25 &v)
Adds the new point but does not update any statistics or do any checks.
Definition Path.hpp:47
Real RMSD() const
The root mean squared distance of the from the straight line between the first and last point (assume...
Definition Path.hpp:34
void add(const Point_25 &)
Adds the new point and updates length and layer change count. Asserts that layer changes don't have p...
void computeLength()
These need to be called whenever segments are added or removed.
Definition Geometry.hpp:131