Program: 150684
Project: 150684
Buggy source:
@Override public void renderTarget(Object layout,double length3D,GrayF32 image,List<Point2D_F64> points2D){
  ConfigCircleHexagonalGrid config=(ConfigCircleHexagonalGrid)layout;
  double radiusPixels=20;
  double centerDistancePixels=2 * radiusPixels * config.centerDistance / config.circleDiameter;
  double borderPixels=30;
  double spaceX=centerDistancePixels / 2.0;
  double spaceY=centerDistancePixels * Math.sin(UtilAngle.radian(60));
  int imageWidth=(int)(borderPixels * 2 + (config.numCols - 1) * spaceX + 2 * radiusPixels + 0.5);
  int imageHeight=(int)(borderPixels * 2 + (config.numRows - 1) * spaceY + 2 * radiusPixels + 0.5);
  double centerDistanceWorld=length3D * centerDistancePixels / (double)imageWidth;
  image.reshape(imageWidth,imageHeight);
  BufferedImage buffered=new BufferedImage(image.width,image.height,BufferedImage.TYPE_INT_BGR);
  Graphics2D g2=buffered.createGraphics();
  g2.setColor(Color.WHITE);
  g2.fillRect(0,0,buffered.getWidth(),buffered.getHeight());
  g2.setColor(Color.BLACK);
  g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_PURE);
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  Ellipse2D.Double ellipse=new Ellipse2D.Double();
  for (int row=0; row < config.numRows; row++) {
    double y=borderPixels + radiusPixels + row * spaceY;
    for (int col=0; col < config.numCols; col++) {
      double x=borderPixels + radiusPixels + col * spaceX;
      if (row % 2 == 1 && col % 2 == 0)       continue;
      if (row % 2 == 0 && col % 2 == 1)       continue;
      ellipse.setFrame(x - radiusPixels,y - radiusPixels,2 * radiusPixels,2 * radiusPixels);
      g2.fill(ellipse);
    }
  }
  ConvertBufferedImage.convertFrom(buffered,image);
  points2D.clear();
  points2D.addAll(createLayout(config.numRows,config.numCols,centerDistanceWorld));
}

Fixed version (ground truth):
@Override public void renderTarget(Object layout,double length3D,GrayF32 image,List<Point2D_F64> points2D){
  ConfigCircleHexagonalGrid config=(ConfigCircleHexagonalGrid)layout;
  double radiusPixels=20;
  double centerDistancePixels=2 * radiusPixels * config.centerDistance / config.circleDiameter;
  double borderPixels=30;
  double spaceX=centerDistancePixels / 2.0;
  double spaceY=centerDistancePixels * Math.sin(UtilAngle.radian(60));
  int imageWidth=(int)(borderPixels * 2 + (config.numCols - 1) * spaceX + 2 * radiusPixels + 0.5);
  int imageHeight=(int)(borderPixels * 2 + (config.numRows - 1) * spaceY + 2 * radiusPixels + 0.5);
  double centerDistanceWorld=length3D * centerDistancePixels / (double)imageWidth;
  image.reshape(imageWidth,imageHeight);
  BufferedImage buffered=new BufferedImage(image.width,image.height,BufferedImage.TYPE_INT_BGR);
  Graphics2D g2=buffered.createGraphics();
  g2.setColor(Color.WHITE);
  g2.fillRect(0,0,buffered.getWidth(),buffered.getHeight());
  g2.setColor(Color.BLACK);
  g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_PURE);
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  Ellipse2D.Double ellipse=new Ellipse2D.Double();
  for (int row=0; row < config.numRows; row++) {
    double y=borderPixels + radiusPixels;
    y+=(config.numRows - 1 - row) * spaceY;
    for (int col=0; col < config.numCols; col++) {
      double x=borderPixels + radiusPixels + col * spaceX;
      if (row % 2 == 1 && col % 2 == 0)       continue;
      if (row % 2 == 0 && col % 2 == 1)       continue;
      ellipse.setFrame(x - radiusPixels,y - radiusPixels,2 * radiusPixels,2 * radiusPixels);
      g2.fill(ellipse);
    }
  }
  ConvertBufferedImage.convertFrom(buffered,image);
  points2D.clear();
  points2D.addAll(createLayout(config.numRows,config.numCols,centerDistanceWorld));
}