// only shift-right supported so far srecord noeq OnePathShifter(OnePathWithOrigin path, bool shiftRight) { Pt pIn, pOut; int direction; int iStep; gettable OnePathWithOrigin outPath; run { assertTrue(shiftRight); outPath = new OnePathWithOrigin; pIn = path.origin(); while (iStep < path.nSteps()) { int step = path.getStep(iStep); Pt dir = onePathDirection(step); if (direction == 0) { direction = step; pOut = ptPlus(path.origin(), rotatePtRight(dir)); outPath.setOrigin(pOut); } outPath.addStep(step); pIn = ptPlus(pIn, dir); ++iStep; } } OnePathWithOrigin get() { if (outPath == null) run(); ret outPath; } }