static G22Mesh g22cloneMesh(G22Mesh m1) { new G22Mesh m2; Map anchorMap = new Map; for (a1 : m1.anchors()) anchorMap.put(a1, m2.newAnchor(a1.pt)); for (c1 : m1.curves()) m2.addCurve(new G22Mesh.Curve( anchorMap.get(c1.start), anchorMap.get(c1.end), new OnePathWithOrigin(c1.path))); ret m2; }