builder.reset();
builder.add(a);
builder.add(b);
builder.add(c);
Box2 bound = builder.getBoundingBox();
int i0 = MathUtil.clamp((int) Math.floor(bound.minimumX() * (double) triangleLookupGridSize), 0, triangleLookupGridSize - 1);
int i1 = MathUtil.clamp((int) Math.floor(bound.maximumX() * (double) triangleLookupGridSize), 0, triangleLookupGridSize - 1);
int j0 = MathUtil.clamp((int) Math.floor(bound.minimumY() * (double) triangleLookupGridSize), 0, triangleLookupGridSize - 1);
int j1 = MathUtil.clamp((int) Math.floor(bound.maximumY() * (double) triangleLookupGridSize), 0, triangleLookupGridSize - 1);
for (int i = i0; i <= i1; i++) {
double x0 = (double) i / (double) triangleLookupGridSize;
double x1 = (double) (i + 1) / (double) triangleLookupGridSize;
for (int j = j0; j <= j1; j++) {
double y0 = (double) j / (double) triangleLookupGridSize;
double y1 = (double) (j + 1) / (double) triangleLookupGridSize;
Box2 cell = new Box2(x0, y0, x1, y1);
if (GeometryUtil.boxIntersectsTriangle(cell, a, b, c)) {
int cellIndex = j * triangleLookupGridSize + i;
int triIndex = fi * maximumTrianglesPerFace + tri / 3;
IntegerArray list = triangleLookup.get(cellIndex);