public void calcSignedDistanceField() {

		// Set up signed distance field
		Vector3d minCoords = new Vector3d();
		Vector3d maxCoords = new Vector3d();
		for (Iterator<Vector3d> it = vertices.iterator(); it.hasNext();) {
			Vector3d vertex = it.next();
			minCoords.set(Math.min(vertex.x, minCoords.x),
					Math.min(vertex.y, minCoords.y),
					Math.min(vertex.z, minCoords.z));
			maxCoords.set(Math.max(vertex.x, maxCoords.x),
					Math.max(vertex.y, maxCoords.y),
					Math.max(vertex.z, maxCoords.z));
		}
		Vector3d coordSize = new Vector3d(maxCoords);
		coordSize.sub(minCoords);
		coordSize.scale(1.5);// 50% padding
		double volume = coordSize.x * coordSize.y * coordSize.z;

		voxelUnit = Math.pow(volume / 8000.0, 1.0 / 3.0);

		xResolution = (int) Math.floor((coordSize.x) / voxelUnit) + 1;
		yResolution = (int) Math.floor((coordSize.y) / voxelUnit) + 1;
		zResolution = (int) Math.floor((coordSize.z) / voxelUnit) + 1;

		signedDistanceFieldSize.set(xResolution - 1, yResolution - 1,
				zResolution - 1);
		signedDistanceFieldSize.scale(voxelUnit);

		signedDistanceFieldMin.set(minCoords);
		signedDistanceFieldMin.add(maxCoords);
		signedDistanceFieldMax.set(signedDistanceFieldMin);

		signedDistanceFieldMin.sub(signedDistanceFieldSize);
		signedDistanceFieldMin.scale(0.5);

		signedDistanceFieldMax.add(signedDistanceFieldSize);
		signedDistanceFieldMax.scale(0.5);

		signedDistanceField = new double[xResolution][yResolution][zResolution];

		for (int i = 0; i < xResolution; i++) {
			for (int j = 0; j < yResolution; j++) {
				for (int k = 0; k < zResolution; k++) {
					signedDistanceField[i][j][k] = 1D / 0D;
				}
			}
		}

		voxelizeTrianglesDirect(voxelUnit);
	}