Problem with generating a tube mesh

I am trying to create a tube mesh. Right now I have a set of circles. Every circle consists of 8 points, which are my vertices for the mesh. My circlePointsList holds all the circle points. I go through the circlePointsList to create my mesh triangles like you can see in the following piece of code:

for(int k = 0; k <= circlePointsList.Count; k++){
				if(k+9 < circlePointsList.Count){

					triangleList.Add(k+1);
					triangleList.Add(k+8);
					triangleList.Add(k);
					triangleList.Add(k+1);
					triangleList.Add(k+8);
					triangleList.Add(k+9);

				}
			}

The result looks like the following pictures:

111399-bildschirmfoto-2018-02-16-um-105737.png

111400-bildschirmfoto-2018-02-16-um-105750.png

As you can see all the triangles are being created. But I do not know why they are not displayed at the same time. If I look inside the object (first picture), all the upper triangles are displayed, and if I look at the object from the outside, only the lower triangles are displayed. Has anyone an idea what could be the problem here?

What determines which side of a triangle is visible (in your case pink), is the orientation of its vertex indices. The way it works is that if they are arranged in a clockwise direction then the triangle is forward-facing and visible. By contrast, a counter-clockwise direction means that the triangle is not rendered and not visible. So, it seems that part of your triangles have clockwise-arranged vertex indices and the other one have counterclockwise-arranged vertex indices. So, create new gameobject, reset its position, add meshfilter, put the script on it, read my comments in the script and play with it by uncommenting and commenting. Here’s the code:

	private void OnValidate()
	{
		MeshFilter mf = gameObject.GetComponent<MeshFilter>();
		
		Vector3[] vertices = new Vector3[]
		{
			new Vector3(-1f, 1f, 0), // index 0 in triangles array
			new Vector3(1f, 1f, 0), // index 1 in triangles array
			new Vector3(1f, -1f, 0), // index 2 in triangles array
			new Vector3(-1f, -1f, 0) // index 3 in triangles array
		};
		
		int[] triangles = new int[]
		{
// Let's assume that you are forward-facing. In other words, looking at the Z axis direction.
// Those indices are arranged clockwise so you will see the triangles
			//0, 1, 2,
			//2, 3, 0
// You will also see these triangles
			//1, 2, 0,
			//3, 0, 2
// And these too. There can be many combinations as you can see:		
			//2, 0, 1,
			//0, 2, 3
// But you won't see them when you arrange them counterclockwise (they are seen from behind), like that:
			//0, 2, 1,
			//0, 3, 2
// Or like that. There can be many combinations:
			//1, 0, 2,
			//0, 3, 2
			
// Your problem, however, is that one triangle has its indices clockwise arranged, and the other one counterclockwise. They just look like that:
			0, 1, 2,
			2, 0, 3
// Of course, in your case, there can be many combinations. It can be also like that:
			//1, 2, 0,
			//0, 3, 2
		};
		
		Mesh mesh = new Mesh();
		mesh.vertices = vertices;
		mesh.triangles = triangles;
		mf.mesh = mesh;
	}