Path subPath(double start, double end, PathType type) { Path result = new Path(); for (int i = 0; i < 20; i++) { double t = (double)i / 20.0; t *= end - start; t += start; result.AddControlPt( getPt( t, type) ); } return result; }
public Path reversed() { Path result = new Path(); for (int i = Count() - 1; i >= 0; i--) result.AddControlPt(m_Points[i]); return result; }
Path getPath(double U1, double V1, double U2, double V2, int numPts) { Path newPath = new Path(); for (int i = 0; i < numPts; i++) { double t = (double)i / (numPts - 1); newPath.AddControlPt( this[U1 + t * (U2 - U1), V1 + t * (V2 - V1)]); } return newPath; }
public GridSpace(Path bottomPath, Path topPath) { m_bottomPath = bottomPath; m_topPath = topPath; }
public static GridSpace fromPath(Path basepath, double height, double width) { Point2D right = (basepath.getEndPt() - basepath.getStartPt()).Normalized; Point2D up = Point2D.FromPolar(1.0, right.Theta + Math.PI/2.0); Point2D topcenter = (basepath.getEndPt() + basepath.getStartPt()) / 2.0 + height * up; return new GridSpace(basepath, new Path( topcenter - width / 2.0 * right, topcenter + width / 2.0 * right)); }