private void voxelizeTriangles(double voxelUnit) {
		for (int t = 0; t < triangles.size(); t++) {
			Vector3d vertex0 = vertices.get(triangles.get(t).v0);
			Vector3d vertex1 = vertices.get(triangles.get(t).v1);
			Vector3d vertex2 = vertices.get(triangles.get(t).v2);
			Vector3d triangleNormal = new Vector3d();
			triangleNormal.cross(new Vector3d(vertex2.x - vertex0.x, vertex2.y
					- vertex0.y, vertex2.z - vertex0.z), new Vector3d(vertex1.x
					- vertex0.x, vertex1.y - vertex0.y, vertex1.z - vertex0.z));

			Vector3d vertex0Shifted = new Vector3d();
			vertex0Shifted.scaleAdd(2 * voxelUnit / triangleNormal.length(),
					triangleNormal, vertex0);
			Vector4d boundingPlanePos = new Vector4d(triangleNormal.x,
					triangleNormal.y, triangleNormal.z,
					-triangleNormal.dot(vertex0Shifted));

			vertex0Shifted.scaleAdd(-2 * voxelUnit / triangleNormal.length(),
					triangleNormal, vertex0);
			Vector4d boundingPlaneNeg = new Vector4d(-triangleNormal.x,
					-triangleNormal.y, -triangleNormal.z,
					triangleNormal.dot(vertex0Shifted));

			Vector3d edgeNormal = new Vector3d();
			edgeNormal.cross(triangleNormal, new Vector3d(
					vertex1.x - vertex0.x, vertex1.y - vertex0.y, vertex1.z
							- vertex0.z));
			Vector4d boundingPlane01 = new Vector4d(edgeNormal);
			boundingPlane01.w = -edgeNormal.dot(vertex0);

			edgeNormal.cross(triangleNormal, new Vector3d(
					vertex2.x - vertex1.x, vertex2.y - vertex1.y, vertex2.z
							- vertex1.z));
			Vector4d boundingPlane12 = new Vector4d(edgeNormal);
			boundingPlane12.w = -edgeNormal.dot(vertex1);

			edgeNormal.cross(triangleNormal, new Vector3d(
					vertex0.x - vertex2.x, vertex0.y - vertex2.y, vertex0.z
							- vertex2.z));
			Vector4d boundingPlane20 = new Vector4d(edgeNormal);
			boundingPlane20.w = -edgeNormal.dot(vertex2);

			for (int i = 0; i < xResolution; i++) {
				for (int j = 0; j < yResolution; j++) {
					for (int k = 0; k < zResolution; k++) {
						Vector3d point = new Vector3d(signedDistanceFieldMin.x
								+ (i + 0.5) * voxelUnit,
								signedDistanceFieldMin.y + (j + 0.5)
										* voxelUnit, signedDistanceFieldMin.z
										+ (k + 0.5) * voxelUnit);
						double dPos = distance(point, boundingPlanePos);
						double dNeg = distance(point, boundingPlaneNeg);
						double d01 = distance(point, boundingPlane01);
						double d12 = distance(point, boundingPlane12);
						double d20 = distance(point, boundingPlane20);

						// all three cylinders
						double dCyl = intersectsCylinder(point, vertex0,
								vertex1);

						if ((dPos <= 0.0 && dNeg <= 0.0 && d01 <= 0.0
								&& d12 <= 0.0 && d20 <= 0.0)) {
							// planar distance
						} else if (dCyl != -1.0 && dCyl <= 2.0) {// All three
																	// cylinders

						} else if (true) {
							// point distance
						}
					}
				}
			}
		}
	}