/** * Gets a contour surface for a specified image value. * * @param c the image value to contour. * @param withNormals true, for normal vectors; false, otherwise. */ public Contour getContour(float c) { IntList tlist = new IntList(); FloatList xlist = new FloatList(); FloatList ulist = _normals ? new FloatList() : null; march( _s1.getCount(), _s2.getCount(), _s3.getCount(), _s1.getDelta(), _s2.getDelta(), _s3.getDelta(), _s1.getFirst(), _s2.getFirst(), _s3.getFirst(), _f, c, tlist, xlist, ulist); Contour contour = new Contour(); contour.i = tlist.trim(); contour.x = xlist.trim(); contour.u = _normals ? ulist.trim() : null; if (_swap13) { float[] x = contour.x; float[] u = contour.u; for (int i = x.length - 3; i >= 0; i -= 3) { float x1 = x[i]; float x3 = x[i + 2]; x[i] = x3; x[i + 2] = x1; if (u != null) { float u1 = u[i]; float u3 = u[i + 2]; u[i] = u3; u[i + 2] = u1; } } } return contour; }