srecord noeq G22VisualizeMeshes(WidthAndHeight originalImage, L meshes) { // can also include alpha settable Color anchorColor = Color.red; settable int anchorSize = 5; // can also include alpha settable Color curveColor = Color.blue; BufferedImage get() { var markedImage = whiteImage(imageSize(originalImage)); drawOn(createGraphics(markedImage)); ret markedImage; } void drawOn(Graphics2D g) { for (mesh : meshes) for (curve : mesh.curves()) drawPixels(g, curve.path().pointIterator(), curveColor); for (mesh : meshes) for (p : mesh.anchorPts()) fillRect(g, p.x-anchorSize/2, p.y-anchorSize/2, anchorSize, anchorSize, anchorColor); } }