3D Printing

3D Printer

Before Fab Academy started, I assembled an Original Prusa MINI+ 3D Printer. Here is the link to that project's documentation.

Paint-On Supports

I watched this tutorial on how to use Paint-On Supports in Prusa Slicer. I then tested this for myself by downloading this model from Thingiverse. I unzipped the folder and opened Prusa Slicer. I clicked the Add button to import an STL into my project.

Add Prusa

I selected the Cobra_v2.STL file from the downloaded folder and it worked!

Imported Cobra

I then moved to the Advanced workspace so that I could use Paint-On Supports.

Advanced Workspace Prusa

The Paint-On Supports button was greyed out, so I first clicked on the model, then I was able to use the tool.

Paint-On Supports Tool Prusa

I left the default settings, painting on the underside of the cobra's head, then changed the Supports setting to For support enforcers only.

Paint-On Support Prusa

I pressed the Slice Now button on the bottom right of the screen, and it was loading for an extremely long time. Eventually I had to shut the program by force because it wasn't loading. I repeated the steps instead painting on the back of the cobra, but I recieved a similar result. I eventually just decided to download this simple model instead. I rotated on its side to test the Paint-On Supports, and it worked!

Painting Supports Simpler

Paint-On Support Succss

Variable Layer Height

I watched this tutorial on how to create Variable Layer Heights in Prusa Slicer to optimize 3D printing. This process changes the detail of the print at different sections of the model to maximize speed and quality.

After opening a model in Prusa Slicer, I did not see the Layer Editing button that the video mentioned. This website shows me that I had to first select the model (before slicing) then find the option in the toolbar. The button in my version of Prusa Slicer appeared different than in the tutorial.

Variable Layer Height Button

I looked at the controls display that appeared to know what buttons to press, and I played around with changing the detail on different layers of the print.

Variable Layer Height Changed

I pressed Slice Now, and it worked!

Variable Layer Height Success

Ironing

I watched this tutorial to learn about ironing techniques to polish the top layer of flat prints. I learned about how to set up ironing in Prusa Slicer as well as the increased time downsides of ironing. I didn't not implement ironing in Prusa Slicer right now, but I certainly will use my learnings in the future if I need a very polished surface on a print.

Other Features

I read this article to gain a high-level understanding of other Advanced and Expert features in Prusa Slicer. My main takeaways were that the Enforce Support for the First setting can add supports to the first couple layers of a print that help the print to stick to the heatbed and that GCODE can be directly written and run in Prusa Slicer.

Procedurally Generating STL Meshes in C# and Unity

Mesh Generation Boilerplate

I already have some experience with procedurally generating 3D meshes from using Unity. I've followed several Brackey's Tutorials on YouTube and made a terrain that infinitelly generated hills and valleys. For my print this week, I wanted to procedurally generate a mesh that cannot be easily created subtractively using C# in Unity then export it as an STL and 3D Print it.

I opened an old project that I made and copied and pasted the following code into a MeshGenerator script. I attached the script to a GameObject with a MeshFilter, MeshRenderer, and MeshCollider.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;
    public float width = 20f;
    public float length = 20f;
    public float slope = 0.25f;
    public float amplitude = 2f;
    public float oscillationSpeed = 2f;
    public float amplitudeOffset = 0f;
    public float layeredOscillationOffset = 1f;

    public float xOffset = 0f;
    public float zOffset = 0f;

    public float seed = 0f;

    Mesh mesh;
    Vector3[] vertices;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
    }

    void Update()
    {
        CreateShape();
        UpdateMesh();
    }

    void CreateShape()
    {
        vertices = new Vector3[(xSize + 1) * (zSize + 1)];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                float xTranslated = (width / xSize) * x + xOffset;
                float zTranslated = (length / zSize) * z + zOffset;
                float y = Mathf.PerlinNoise(seed + xTranslated * .3f, seed + zTranslated * .3f) * 
                    (
                        (Mathf.PingPong(Time.time * oscillationSpeed, amplitude/2) - (amplitude/4))
                        + (Mathf.PingPong((Time.time + layeredOscillationOffset) * oscillationSpeed, amplitude/2) - (amplitude/4))
                        + amplitudeOffset
                    );
                vertices[i] = new Vector3(xTranslated, y + (zTranslated*slope), zTranslated);
                i++;
            }
        }

        triangles = new int[xSize * zSize * 6];

        int vert = 0;
        int tris = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }

    public void SetCenter(float x)
    {
        xOffset = x - (width / 2);
    }

    public void SetEnd(float z)
    {
        zOffset = z;
    }
}

I removed the oscillation features and changed the script to the following.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;
    public float yOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
    }

    void Update()
    {
        CreateShape();
        UpdateMesh();
    }

    void CreateShape()
    {
        vertices = new Vector3[(xSize + 1) * (zSize + 1)];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                vertices[i] = new Vector3(x, yOffset, z);
                i++;
            }
        }

        triangles = new int[xSize * zSize * 6];

        int vert = 0;
        int tris = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

Yet I only saw a pink plane, so I added the Default-Diffuse material to the MeshRenderer, and it worked!

Mapping A Plane To An Cylinder

First I wanted to map a plane to a cylinder. If I could figure out a function that takes in a 2-dimensional coordinate of on the plane (x0, y0) and map it to a 3-dimensional point on a cylidner (x, y, z) that way I could keep the same array as the plane for creating triangles out of groups of 3 vertices. I spent a lot of time thinking about this so I'd have a clear plan going into programming. I wanted to use trigonometry functions to map a x-coordinate of the vertex on the plane to the x and y coordinates of the 3D point.Based off of what I learned in a trigonometry class last year as well as this website, I tested mapping the angle of a line in the unit circle to a point on the circle using the cos and sin functions. Here is a picture of my test using desmos (I used this website to turn my document into degrees).

Failed Desmos

I realized that a line of slope 0.5 isn't 45/2 degrees, so I asked ChatGPT and learned that it should be 26.57 deg.

Prompt

what is the angle in degrees relative to y=0 of a line with slope 0.5

Response

A line with slope 0.5 makes an angle of approximately 26.57 degrees with the positive direction of the x-axis, which is also the angle in degrees relative to y=0.

To see why this is the case, note that the slope of a line is defined as the ratio of the change in y to the change in x. In other words, if we move x units to the right along the line, we will move 0.5x units up (or down, if the slope is negative).

Now consider a right triangle formed by the line, the x-axis, and a vertical line passing through the point where the line intersects the y-axis. The opposite side of this triangle is the vertical distance between the y-axis and the point on the line directly above it, which is the same as the y-intercept of the line. The adjacent side is the horizontal distance between this point and the origin (0,0).

Since the slope of the line is 0.5, the opposite side of the triangle is half as long as the adjacent side. Thus, we have tan(theta) = opposite/adjacent = 0.5, where theta is the angle we want to find. Taking the inverse tangent of both sides, we get:

theta = tan^-1(0.5)

Using a calculator, we find that theta is approximately 26.57 degrees.

With this value, the desmos simulation worked! (I didn't want to just use 45 deg because this would have still worked if I had cos and sin flipped).

Working Desmos

I recognize that I could have simply asked ChatGPT for the whole program, but I wanted to learn how to program it myself. I also recognize that I could have calculated the formula for a line at a given angle then solved for the intersection with the unit circle, but I decided against this because it requires an extra step of figuring out which of the two intersections between the line and the circle is desired.

I wrote the formula f(x0 ,y0) = (cos(x0/x), sin(x0/x), y0) to map the plane to a cylinder.

Plane To Cylinder Math

I divided x0 by x because I want to only have one full cycle of the cos and sin functions where for sin(n) or cos(n), n ∈ [0,1]. x represents the number of vertices in the x-direction on the plane, as shown in the drawing.

Here is my implementation in the code (the plane starts with x and z so the output function is really (cos(x0/x), sin(x0/x), z)). I also added an xOffset and yOffset parameter so I can easily move the model in Unity.

This didn't work. I flipped x and z in my code because I thought something was weird with nested loops and the mesh was inside out, but I just got a wihte plane. I played around in desmos and realized that my calculations were being confused between radians and degrees and that I had to multiple the input by . I switched back x and z but this didn't work, so I tried flipping them again which also failed. I then decided to log each vertex's position and I the logs collapsed to only a few values so I realized the circle simply wasn't moving across the z-axis. I realized this was because I didn't cast an integer to a floating point value in a division operation - I figured this out because when I logged the x-coordinate with cos then without cos it was always 0 or 1. Now it works better, but the mesh is still inside out.

Inside Out Cylinder

I flipped x and z again, then it worked!

Mapping A Plane To A Torus

problem is it's a face and its one-sided -- no thickness

I modified the code to the following, but got an error that vertices wasn't long enough, so I changed my formula for the length of vertices.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize + 1) * (zSize + 1)];
        verticesInside = new Vector3[(xSize + 1) * (zSize + 1)];
        vertices = new Vector3[(xSize + 1) * (zSize * 2 + 1)];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                i++;
            }
        }

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < vertices.Length; ++i)
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];

        triangles = new int[xSize * zSize * 6];

        int vert = 0;
        int tris = 0;

        for (int z = 0; z < zSize*2; z++) // * 2 bc inside and outside
        {
            for (int x = 0; x < xSize; x++) // not * 2 bc x with is the same
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I realized for the second loop I accidentally looped through the lengths of vertices, not verticesInside.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize + 1) * (zSize + 1)];
        verticesInside = new Vector3[(xSize + 1) * (zSize + 1)];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                i++;
            }
        }

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            Debug.Log("Vertices " + vertices.Length.ToString() + " " + (i + verticesOutside.Length).ToString());
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        triangles = new int[xSize * zSize * 6];

        int vert = 0;
        int tris = 0;

        for (int z = 0; z < zSize*2; z++) // * 2 bc inside and outside
        {
            for (int x = 0; x < xSize; x++) // not * 2 bc x with is the same
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I then had another error that the triangles list was too short, so I multiplied the length by two because the z-dimension was multiplied by 2.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize + 1) * (zSize + 1)];
        verticesInside = new Vector3[(xSize + 1) * (zSize + 1)];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                i++;
            }
        }

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            Debug.Log("Vertices " + vertices.Length.ToString() + " " + (i + verticesOutside.Length).ToString());
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        triangles = new int[xSize * zSize * 2 * 6];

        int vert = 0;
        int tris = 0;

        for (int z = 0; z < zSize*2; z++) // * 2 bc inside and outside
        {
            for (int x = 0; x < xSize; x++) // not * 2 bc x with is the same
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I now saw both cylinders, but the inside one is now inside out.

Inside Cylinder Inside Out

So, I flipped x and z only on the inside loop.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize + 1) * (zSize + 1)];
        verticesInside = new Vector3[(xSize + 1) * (zSize + 1)];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                i++;
            }
        }

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            Debug.Log("Vertices " + vertices.Length.ToString() + " " + (i + verticesOutside.Length).ToString());
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        triangles = new int[xSize * zSize * 2 * 6];

        int vert = 0;
        int tris = 0;

        for (int z = 0; z < zSize*2; z++) // * 2 bc inside and outside
        {
            for (int x = 0; x < xSize; x++) // not * 2 bc x with is the same
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

Now it's closer, but still not perfect.

Connection Fail

I realized another error could be the triangles in between the inside and outside because I reversed the inside list so probably it mirrored the vertices on the circle.

So, I tried flipping the order of the x-axis loop in the second loop.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize + 1) * (zSize + 1)];
        verticesInside = new Vector3[(xSize + 1) * (zSize + 1)];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                i++;
            }
        }

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x++)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            Debug.Log("Vertices " + vertices.Length.ToString() + " " + (i + verticesOutside.Length).ToString());
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        triangles = new int[xSize * zSize * 2 * 6];

        int vert = 0;
        int tris = 0;

        for (int z = 0; z < zSize*2; z++) // * 2 bc inside and outside
        {
            for (int x = 0; x < xSize; x++) // not * 2 bc x with is the same
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I also noted that I got a little muddled between y and z in my on-paper planning and my implementation, but later my usage clears up.

I got an out of index error, but realized I simply forgot to flip the loop incrementor to --.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize + 1) * (zSize + 1)];
        verticesInside = new Vector3[(xSize + 1) * (zSize + 1)];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                i++;
            }
        }

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            Debug.Log("Vertices " + vertices.Length.ToString() + " " + (i + verticesOutside.Length).ToString());
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        triangles = new int[xSize * zSize * 2 * 6];

        int vert = 0;
        int tris = 0;

        for (int z = 0; z < zSize*2; z++) // * 2 bc inside and outside
        {
            for (int x = 0; x < xSize; x++) // not * 2 bc x with is the same
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I played around with reversing the direction of the inside cylinder, but couldn't get anything to work.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize + 1) * (zSize + 1)];
        verticesInside = new Vector3[(xSize + 1) * (zSize + 1)];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                i++;
            }
        }

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, zSize - (z + 1)/* + zOffset*/);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            Debug.Log("Vertices " + vertices.Length.ToString() + " " + (i + verticesOutside.Length).ToString());
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        triangles = new int[xSize * zSize * 2 * 6];

        int vert = 0;
        int tris = 0;

        for (int z = 0; z < zSize*2; z++) // * 2 bc inside and outside
        {
            for (int x = 0; x < xSize; x++) // not * 2 bc x with is the same
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

So, I decided to decrease the x-size and z-size to 4 in the Unity inspector. I also increased the outside radius to 4 and the inside radius to 2 to make everyhting more visible.

Gizmos

To better track my error, I used this forum to help me draw numbers on to each of the vertices.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize + 1) * (zSize + 1)];
        verticesInside = new Vector3[(xSize + 1) * (zSize + 1)];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x <= xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                i++;
            }
        }

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, zSize - (z + 1)/* + zOffset*/);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            Debug.Log("Vertices " + vertices.Length.ToString() + " " + (i + verticesOutside.Length).ToString());
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        triangles = new int[xSize * zSize * 2 * 6];

        int vert = 0;
        int tris = 0;

        for (int z = 0; z < zSize*2; z++) // * 2 bc inside and outside
        {
            for (int x = 0; x < xSize; x++) // not * 2 bc x with is the same
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I turned off the MeshRenderer, and the result was amazing!

Number Gizmos

I couldn't find 0, so I logged its coordinates. I also removed the old console logging code. This logged (4,0,0), and I realized that there were two overlapping numbers! I believe found my problem!

Overlap Gizmo

Since I now had a smaller number of vertices, I just printed them all out in the console. I quickly realized that when I flipped x and z in the first loop to inside-out the outer cylinder, I also rotated the plane by 90 degrees. I still decided to follow along with the pattern to see whether this was ok.

I realized that I was repeating the first vertex twice because I had <= instead of < in the first loop.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize + 1) * (zSize + 1)];
        verticesInside = new Vector3[(xSize + 1) * (zSize + 1)];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)z / zSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)z / zSize) * 2 * Mathf.PI) + yOffset, x + zOffset);
                Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, zSize - (z + 1)/* + zOffset*/);
                Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        triangles = new int[xSize * zSize * 2 * 6];

        int vert = 0;
        int tris = 0;

        for (int z = 0; z < zSize*2; z++) // * 2 bc inside and outside
        {
            for (int x = 0; x < xSize; x++) // not * 2 bc x with is the same
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I flipped all back to original x and z then separated the triangles list into two lists

After much thought and messing around, I finally got it to work for the outside cylinder.

Working Outside Wireframe

Working Outside Rendered

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize + 1) * (zSize + 1)];
        verticesInside = new Vector3[(xSize + 1) * (zSize + 1)];
        vertices = new Vector3[verticesOutside.Length/* + verticesInside.Length*/];

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z <= zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, zSize - (z + 1)/* + zOffset*/);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        triangles = new int[xSize * zSize * /*2 **/ 6];

        ///int vert = 0;
        //int tris = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                Debug.Log("YYY");
                Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
            }
        }
        Debug.Log("XXX");
        foreach (int v in triangles)
            Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I realize that I reinterpreted xSize and zSize from the original code to be the units of length across each side to the number of points on each side, so this was why I changed the lengths of the vertices arrays. I also realized that in both loops I has <= zSize not just < zSize for the same reason.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, zSize - (z + 1)/* + zOffset*/);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        foreach (Vector3 v in vertices)
            Debug.Log(v);

        triangles = new int[xSize * zSize * /*2 **/ 6];

        ///int vert = 0;
        //int tris = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
            }
        }
        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I realized inside cylinder was inside out so I reversed the z-axis loop of the inside cylinder.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        foreach (Vector3 v in vertices)
            Debug.Log(v);

        triangles = new int[xSize * zSize * /*2 **/ 6];

        ///int vert = 0;
        //int tris = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
            }
        }
        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

Fixed Inside Out Inner

To my shock, this worked perfectly only after changing the second loop's condition from <= zSize - 1 to <= zSize - 2 because I rewrote the algorithm to where each pass creates a square out of two triangles, so the last loop would create one where vertices don't exist.

Near Success

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;

                filledLength += 6;
            }
        }

        int triangleStarting = zSize * xSize;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                Debug.Log("YYY");
                Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 5] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
            }
        }

        //Debug.Log("XXX");
        foreach (int v in triangles)
            Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

The only thing I had left to do was to patch the back of the structure together.

Back Open

I was trying to figure out why my code wasn't working, so I logged out all of the vertices and where they were in the triangle, which revealed to me that somewhere I got offset and needed to shift all of the vertices over by one in the array.

Offset Numbers

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;

                filledLength += 6;
            }
        }

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
            }
        }

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 2] = k + 1;
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            triangles[c + finalIndex + 5] = k + 1;
            c += 6;
        }


        for (int i = 0; i < triangles.Length; ++i)
        {
            Debug.Log((i % 3).ToString()+ ":" + triangles[i].ToString());
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I tried logging in more detail to figure out the issue.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;

                filledLength += 6;
            }
        }

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
            }
        }

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            Debug.Log((c + finalIndex + 0).ToString() + " : " + ((c + finalIndex + 0)%3).ToString() + " : " + k.ToString())
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            Debug.Log((c + finalIndex + 1).ToString() + " : " + ((c + finalIndex + 1) % 3).ToString() + " : " + (xSize * zSize * 2 - xSize + k).ToString());
            triangles[c + finalIndex + 2] = k + 1;
            Debug.Log((c + finalIndex + 2).ToString() + " : " + ((c + finalIndex + 2) % 3).ToString() + " : " + (k + 1).ToString());
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            Debug.Log((c + finalIndex + 3).ToString() + " : " + ((c + finalIndex + 3) % 3).ToString() + " : " + (xSize * zSize * 2 - xSize + k).ToString());
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            Debug.Log((c + finalIndex + 4).ToString() + " : " + ((c + finalIndex + 4) % 3).ToString() + " : " + (xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0)).ToString());
            triangles[c + finalIndex + 5] = k + 1;
            Debug.Log((c + finalIndex + 5).ToString() + " : " + ((c + finalIndex + 5) % 3).ToString() + " : " + (k + 1).ToString());
            c += 6;
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I realized that the second loop's items started on a module value of 2, not 0, so I printed out more things to find the problem. I also simplified the previous debug statements.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                filledLength += 6;
            }
        }

        Debug.Log("STARTING SECOND LOOP");

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                for (int i = filledLength + (z * xSize * 6) + (6 * x) + 0; i < filledLength + (z * xSize * 6) + (6 * x) + 6; i++)
                {
                    Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
                }
            }
        }

        Debug.Log("STARTING SECOND LOOP");

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 2] = k + 1;
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            triangles[c + finalIndex + 5] = k + 1;
            for (int i = c + finalIndex + 0; i < c + finalIndex + 6; i++)
            {
                Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
            }
            c += 6;
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I realized that when I was starting the second loop, I was overwrting the last item from the first loop, so I added 1 to finalIndex before the second loop, and now I was so close!

So Close

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                filledLength += 6;
            }
        }

        Debug.Log("STARTING SECOND LOOP");

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                for (int i = filledLength + (z * xSize * 6) + (6 * x) + 0; i < filledLength + (z * xSize * 6) + (6 * x) + 6; i++)
                {
                    Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
                }
            }
        }

        Debug.Log("STARTING SECOND LOOP");
        finalIndex += 1;

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 2] = k + 1;
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            triangles[c + finalIndex + 5] = k + 1;
            for (int i = c + finalIndex + 0; i < c + finalIndex + 6; i++)
            {
                Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
            }
            c += 6;
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

This allowed me to fix the very last triangle using the % xSize operation, and now it works!!!

Working Mesh

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        CreateShape();
        UpdateMesh();
    }

    void Update()
    {
        //CreateShape();
        //UpdateMesh();
    }

    void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                filledLength += 6;
            }
        }

        Debug.Log("STARTING SECOND LOOP");

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                for (int i = filledLength + (z * xSize * 6) + (6 * x) + 0; i < filledLength + (z * xSize * 6) + (6 * x) + 6; i++)
                {
                    Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
                }
            }
        }

        Debug.Log("STARTING SECOND LOOP");
        finalIndex += 1;

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 2] = (k + 1) % xSize;
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            triangles[c + finalIndex + 5] = (k + 1) % xSize;
            for (int i = c + finalIndex + 0; i < c + finalIndex + 6; i++)
            {
                Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
            }
            c += 6;
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

Realtime Mesh Updates With Inspector

Also, throughout this whole process there have been compiler errors whenever I exit play mode because the number gizmos are still trying to be drawn, so I commented out those parts of the code. I removed the CreateShape() and UpdateShape() functions from the Start() to the Update() method and implemented caching to improve performance where the model only rerenders when the parameters have changed. I could check all variables individually and cache their values by hand, but I actually decided to abandon the Update() method and move the functions to the OnValidate() method, suggested by this forum. I also called OnValidate() at the beginning of the start method so that the MeshRenderer always had a mesh to display (I recieved a runtime error before adding this instruction). I also implemented checks so that the mesh would only render when the values are valid. I could just create a button for generating the mesh, but I like being able to scroll across different values in the inspector better. I also commented out a lot of the Debug.Log statements which I believe were causing the code to run much slower.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//using UnityEditor;

public class MeshGenerator : MonoBehaviour
{

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        //CreateShape();
        //UpdateMesh();
        OnValidate();
    }

    void OnValidate()
    {
        if ((xSize < 3 || zSize < 2) || (outsideRadius <= insideRadius))
        {
            Debug.LogWarning("Error Calculating Mesh");
            return;
        }
        CreateShape();
        UpdateMesh();
    }

    /*void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }*/

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3((outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3((insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, (insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                filledLength += 6;
            }
        }

        //Debug.Log("STARTING SECOND LOOP");

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                //for (int i = filledLength + (z * xSize * 6) + (6 * x) + 0; i < filledLength + (z * xSize * 6) + (6 * x) + 6; i++)
                //{
                    //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
                //}
            }
        }

        //Debug.Log("STARTING SECOND LOOP");
        finalIndex += 1;

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 2] = (k + 1) % xSize;
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            triangles[c + finalIndex + 5] = (k + 1) % xSize;
            //for (int i = c + finalIndex + 0; i < c + finalIndex + 6; i++)
            //{
                //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
            //}
            c += 6;
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

Now the generation was so much faster!

Layering Random Noise

Now I wanted to layer perlin noise on the circle diameters to create a smooth, wavy pattern. I'll also add a seed variable in the inspector. I also made a variable that can decrease the space between the z-axis vertices so that the waves are smoother. In the future I might also want to implement layering perlin noise for different points around the circumference of each circle in the cylinder. Here is my first stab at the code which isn't exactly working. I am aware it's not very clean and has a lot of copying and pasting, but for right now it is sufficient.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//using UnityEditor;

public class MeshGenerator : MonoBehaviour
{
    public float seed = 0f;
    public bool layerPerlinNoise = true;

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        //CreateShape();
        //UpdateMesh();
        OnValidate();
    }

    void OnValidate()
    {
        if ((xSize < 3 || zSize < 2) || (outsideRadius <= insideRadius))
        {
            Debug.LogWarning("Error Calculating Mesh");
            return;
        }
        CreateShape();
        UpdateMesh();
    }

    /*void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }*/

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3(((layerPerlinNoise ? Mathf.PerlinNoise(x, seed) : 1)*outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? Mathf.PerlinNoise(x, seed) : 1) * outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3(((layerPerlinNoise ? Mathf.PerlinNoise(x, seed) : 1)*insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? Mathf.PerlinNoise(x, seed) : 1) * insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                filledLength += 6;
            }
        }

        //Debug.Log("STARTING SECOND LOOP");

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                //for (int i = filledLength + (z * xSize * 6) + (6 * x) + 0; i < filledLength + (z * xSize * 6) + (6 * x) + 6; i++)
                //{
                    //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
                //}
            }
        }

        //Debug.Log("STARTING SECOND LOOP");
        finalIndex += 1;

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 2] = (k + 1) % xSize;
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            triangles[c + finalIndex + 5] = (k + 1) % xSize;
            //for (int i = c + finalIndex + 0; i < c + finalIndex + 6; i++)
            //{
                //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
            //}
            c += 6;
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I realized I was just using x instead of z, so I fixed it and now it works somewhat.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//using UnityEditor;

public class MeshGenerator : MonoBehaviour
{
    public float seed = 0f;
    public bool layerPerlinNoise = true;

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        //CreateShape();
        //UpdateMesh();
        OnValidate();
    }

    void OnValidate()
    {
        if ((xSize < 3 || zSize < 2) || (outsideRadius <= insideRadius))
        {
            Debug.LogWarning("Error Calculating Mesh");
            return;
        }
        CreateShape();
        UpdateMesh();
    }

    /*void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }*/

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3(((layerPerlinNoise ? Mathf.PerlinNoise(z, seed) : 1)*outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? Mathf.PerlinNoise(z, seed) : 1) * outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3(((layerPerlinNoise ? Mathf.PerlinNoise(z, seed) : 1)*insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? Mathf.PerlinNoise(z, seed) : 1) * insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                filledLength += 6;
            }
        }

        //Debug.Log("STARTING SECOND LOOP");

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                //for (int i = filledLength + (z * xSize * 6) + (6 * x) + 0; i < filledLength + (z * xSize * 6) + (6 * x) + 6; i++)
                //{
                    //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
                //}
            }
        }

        //Debug.Log("STARTING SECOND LOOP");
        finalIndex += 1;

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 2] = (k + 1) % xSize;
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            triangles[c + finalIndex + 5] = (k + 1) % xSize;
            //for (int i = c + finalIndex + 0; i < c + finalIndex + 6; i++)
            //{
                //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
            //}
            c += 6;
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I need to implmenet a steepness cutoff, but before I get ahead of myself, I need to make the z-axis closer together. I'll also add a variable that is multiplied by the perlin noise to decrease the amplitude of the waves. I also wnat to add sliders in the inspector so the valid values are ensured.

I originally tried multiplying the perlin noise value by the amplitude variable, but this led to extreme shrinkage of the model when the amplitude was below one, so instead, I added the perlin noise times the amplitude to the radius, and this worked!

Working Amplitude

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//using UnityEditor;

public class MeshGenerator : MonoBehaviour
{
    public float seed = 0f;
    public bool layerPerlinNoise = true;
    public float amplitudeMultiplier = 1f;

    public int xSize = 20;
    public int zSize = 20;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        //CreateShape();
        //UpdateMesh();
        OnValidate();
    }

    void OnValidate()
    {
        if ((xSize < 3 || zSize < 2) || (outsideRadius <= insideRadius) || (amplitudeMultiplier <= 0))
        {
            Debug.LogWarning("Error Calculating Mesh");
            return;
        }
        CreateShape();
        UpdateMesh();
    }

    /*void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }*/

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3(((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z, seed) : 1)+outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z, seed) : 1) + outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3(((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z, seed) : 1)+insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z, seed) : 1) + insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                filledLength += 6;
            }
        }

        //Debug.Log("STARTING SECOND LOOP");

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                //for (int i = filledLength + (z * xSize * 6) + (6 * x) + 0; i < filledLength + (z * xSize * 6) + (6 * x) + 6; i++)
                //{
                    //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
                //}
            }
        }

        //Debug.Log("STARTING SECOND LOOP");
        finalIndex += 1;

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 2] = (k + 1) % xSize;
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            triangles[c + finalIndex + 5] = (k + 1) % xSize;
            //for (int i = c + finalIndex + 0; i < c + finalIndex + 6; i++)
            //{
                //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
            //}
            c += 6;
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I added a zSpacing variable that represents the space between two coordinates on the z-axis, but this only shrunk the model instead of making it more defined because I didn't change in the input into the perlin noise function.

Shrunk Z

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//using UnityEditor;

public class MeshGenerator : MonoBehaviour
{
    public float seed = 0f;
    public bool layerPerlinNoise = true;
    public float amplitudeMultiplier = 1f;

    public int xSize = 20;
    public int zSize = 20;

    public float zSpacing = 0.5f;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        //CreateShape();
        //UpdateMesh();
        OnValidate();
    }

    void OnValidate()
    {
        if ((xSize < 3 || zSize < 2) || (outsideRadius <= insideRadius) || (amplitudeMultiplier <= 0) || (zSpacing <= 0))
        {
            Debug.LogWarning("Error Calculating Mesh");
            return;
        }
        CreateShape();
        UpdateMesh();
    }

    /*void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }*/

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3(((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z, seed) : 1)+outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z, seed) : 1) + outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, zSpacing * z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3(((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z, seed) : 1)+insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z, seed) : 1) + insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, zSpacing * z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                filledLength += 6;
            }
        }

        //Debug.Log("STARTING SECOND LOOP");

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                //for (int i = filledLength + (z * xSize * 6) + (6 * x) + 0; i < filledLength + (z * xSize * 6) + (6 * x) + 6; i++)
                //{
                    //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
                //}
            }
        }

        //Debug.Log("STARTING SECOND LOOP");
        finalIndex += 1;

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 2] = (k + 1) % xSize;
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            triangles[c + finalIndex + 5] = (k + 1) % xSize;
            //for (int i = c + finalIndex + 0; i < c + finalIndex + 6; i++)
            //{
                //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
            //}
            c += 6;
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

Then it worked! When I first implemented this I got some weird moving of the ridges but realized I only modified two out of the four perlin noise functions in the code. Now I implemented all of them and it's successful

Working Scaled Z

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//using UnityEditor;

public class MeshGenerator : MonoBehaviour
{
    public float seed = 0f;
    public bool layerPerlinNoise = true;
    public float amplitudeMultiplier = 1f;

    public int xSize = 20;
    public int zSize = 20;

    public float zSpacing = 0.5f;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        //CreateShape();
        //UpdateMesh();
        OnValidate();
    }

    void OnValidate()
    {
        if ((xSize < 3 || zSize < 2) || (outsideRadius <= insideRadius) || (amplitudeMultiplier <= 0) || (zSpacing <= 0))
        {
            Debug.LogWarning("Error Calculating Mesh");
            return;
        }
        CreateShape();
        UpdateMesh();
    }

    /*void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }*/

    void CreateShape()
    {
        verticesOutside = new Vector3[(xSize ) * (zSize )];
        verticesInside = new Vector3[(xSize ) * (zSize )];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3(((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z * zSpacing, seed) : 1)+outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z * zSpacing, seed) : 1) + outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, zSpacing * z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3(((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z * zSpacing, seed) : 1)+insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z * zSpacing, seed) : 1) + insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, zSpacing * z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                filledLength += 6;
            }
        }

        //Debug.Log("STARTING SECOND LOOP");

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                //for (int i = filledLength + (z * xSize * 6) + (6 * x) + 0; i < filledLength + (z * xSize * 6) + (6 * x) + 6; i++)
                //{
                    //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
                //}
            }
        }

        //Debug.Log("STARTING SECOND LOOP");
        finalIndex += 1;

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 2] = (k + 1) % xSize;
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            triangles[c + finalIndex + 5] = (k + 1) % xSize;
            //for (int i = c + finalIndex + 0; i < c + finalIndex + 6; i++)
            //{
                //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
            //}
            c += 6;
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I also noticed that sometimes when I got to a really high number of triangles, the face of the model would cut off and I could see a circle moving back across the model as I increased the number of points, but I assume this is simply a problem with real-time mesh generation in Unity.

Cut Face

Exporting The Mesh

I found values I'm happy with and followed this forum post to help me export my procedurally generated mesh as an STL file.

Final Values

I didn't want to use the plugin if I could avoid the entire setup to I found this forum post which helped me directly save the mesh as a .asset file. Here are two tries which didn't work for me.

AssetDatabase.CreateAsset(mesh, "./my-asset.asset");
AssetDatabase.SaveAssets();
AssetDatabase.CreateAsset(mesh, "./Assets/my-asset.asset");
AssetDatabase.SaveAssets();

Then this post taught me they needed to be revised to the following.

AssetDatabase.CreateAsset(mesh, "Assets/my-asset.asset");
AssetDatabase.SaveAssets();

So here's the final script.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MeshGenerator : MonoBehaviour
{
    public float seed = 0f;
    public bool layerPerlinNoise = true;
    public float amplitudeMultiplier = 1f;

    public bool temp = false;

    public int xSize = 20;
    public int zSize = 20;

    public float zSpacing = 0.5f;

    public float outsideRadius = 1.0f;
    public float insideRadius = 0.9f;

    public float xOffset = 0f;
    public float yOffset = 0f;
    public float zOffset = 0f;

    Mesh mesh;
    Vector3[] vertices;
    Vector3[] verticesOutside;
    Vector3[] verticesInside;
    int[] triangles;

    void Start()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        //CreateShape();
        //UpdateMesh();
        OnValidate();
    }

    void Update()
    {
        if (temp)
        {
            AssetDatabase.CreateAsset(mesh, "Assets/my-asset.asset");
            AssetDatabase.SaveAssets();
        }
    }

    void OnValidate()
    {
        if ((xSize < 3 || zSize < 2) || (outsideRadius <= insideRadius) || (amplitudeMultiplier <= 0) || (zSpacing <= 0))
        {
            Debug.LogWarning("Error Calculating Mesh");
            return;
        }
        CreateShape();
        UpdateMesh();
    }

    /*void OnDrawGizmos()
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            Handles.Label(vertices[i], i.ToString());
        }
    }*/

    void CreateShape()
    {
        verticesOutside = new Vector3[xSize * zSize];
        verticesInside = new Vector3[xSize * zSize];
        vertices = new Vector3[verticesOutside.Length + verticesInside.Length];

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                verticesOutside[i] = new Vector3(((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z * zSpacing, seed) : 1)+outsideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z * zSpacing, seed) : 1) + outsideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, zSpacing * z + zOffset);
                //Debug.Log(verticesOutside[i]);
                i++;
            }
        }

        for (int i = 0, z = 0; z < zSize; z++)
        {
            for (int x = xSize-1; x >= 0; x--)
            {
                verticesInside[i] = new Vector3(((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z * zSpacing, seed) : 1)+insideRadius)*Mathf.Cos(((float)x / xSize) * 2 * Mathf.PI) + xOffset, ((layerPerlinNoise ? amplitudeMultiplier * Mathf.PerlinNoise(z * zSpacing, seed) : 1) + insideRadius)*Mathf.Sin(((float)x / xSize) * 2 * Mathf.PI) + yOffset, zSpacing * z + zOffset);
                //Debug.Log(verticesInside[i]);
                i++;
            }
        }

        for (int i = 0; i < verticesOutside.Length; ++i)
            vertices[i] = verticesOutside[i];
        for (int i = 0; i < verticesInside.Length; ++i)
        {
            //Debug.Log(i + verticesOutside.Length);
            vertices[i + verticesOutside.Length] = verticesInside[verticesInside.Length - (i + 1)];
        }

        //foreach (Vector3 v in vertices)
        //    Debug.Log(v);

        triangles = new int[xSize * zSize * 2 * 6];

        ///int vert = 0;
        //int tris = 0;

        int filledLength = 0;

        for (int z = 0; z < zSize; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log((z * xSize * 6) + (6 * x) + 0);
                triangles[(z * xSize * 6) + (6 * x) + 0] = (z * xSize) + (x + 0);
                triangles[(z * xSize * 6) + (6 * x) + 1] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 2] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 3] = (z * xSize) + (x + xSize);
                triangles[(z * xSize * 6) + (6 * x) + 4] = (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[(z * xSize * 6) + (6 * x) + 5] = (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                filledLength += 6;
            }
        }

        //Debug.Log("STARTING SECOND LOOP");

        int triangleStarting = zSize * xSize;

        int finalIndex = 0;

        for (int z = 0; z < zSize - 1; z++)
        {
            for (int x = 0; x < xSize; x++)
            {
                /*triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + 1;
                triangles[tris + 2] = vert + xSize + 1;*/

                /*vert++;
                tris += xSize * 2;*/
                //Debug.Log("YYY");
                //Debug.Log(filledLength + (z * xSize * 6) + (6 * x) + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 0] = triangleStarting + (z * xSize) + (x + 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 1] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 2] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 3] = triangleStarting + (z * xSize) + (x + xSize);
                triangles[filledLength + (z * xSize * 6) + (6 * x) + 4] = triangleStarting + (z * xSize) + (x + 1) - (x == xSize - 1 ? xSize : 0);
                finalIndex = filledLength + (z * xSize * 6) + (6 * x) + 5;
                triangles[finalIndex] = triangleStarting + (z * xSize) + (x + xSize) - (x == xSize - 1 ? xSize : 0) + 1;
                //for (int i = filledLength + (z * xSize * 6) + (6 * x) + 0; i < filledLength + (z * xSize * 6) + (6 * x) + 6; i++)
                //{
                    //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
                //}
            }
        }

        //Debug.Log("STARTING SECOND LOOP");
        finalIndex += 1;

        int c = 0;

        for (int k = 0; k < xSize; k++)
        {
            triangles[c + finalIndex + 0] = k;
            triangles[c + finalIndex + 1] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 2] = (k + 1) % xSize;
            triangles[c + finalIndex + 3] = xSize * zSize * 2 - xSize + k;
            triangles[c + finalIndex + 4] = xSize * zSize * 2 - xSize + k + 1 - (k == xSize - 1 ? xSize : 0);
            triangles[c + finalIndex + 5] = (k + 1) % xSize;
            //for (int i = c + finalIndex + 0; i < c + finalIndex + 6; i++)
            //{
                //Debug.Log(i.ToString() + " : " + (i % 3).ToString() + " : " + triangles[i].ToString());
            //}
            c += 6;
        }

        //Debug.Log("XXX");
        //foreach (int v in triangles)
        //    Debug.Log(v);

        /*for (int z = 0; z < zSize; z++) 
        {
            for (int x = 0; x < xSize; x++)
            {
                triangles[tris + 0] = vert + 0;
                triangles[tris + 1] = vert + xSize + 1;
                triangles[tris + 2] = vert + 1;
                triangles[tris + 3] = vert + 1;
                triangles[tris + 4] = vert + xSize + 1;
                triangles[tris + 5] = vert + xSize + 2;

                vert++;
                tris += 6;
            }
            vert++;
        }*/
    }

    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = vertices;
        mesh.triangles = triangles;

        mesh.RecalculateNormals();
        mesh.RecalculateTangents();

        GetComponent<MeshCollider>().sharedMesh = mesh;
    }
}

I put this in the Update() method under an if statment with a boolean temp. Then in Unity I made the mesh I wanted, clicked pause, set temp to true in the inspector, moved one frame forward, then unchecked temp. This allowed me to export the file one time after I had the settings I wanted. Now I had an .asset file that I couldn't export to an STL or OBJ!

My-Asset

So I tried going back and using a plugin with this tutorial to export an OBJ. In Unity's package manager I didn't see this package, only FBX Exporter, so I downloaded it.

FBX Exporter

I then clicked on my-asset.asset and went to GameObject > Export To FBX... in the top toolbar in the Unity window. I entered the filename and pressed Export.

Using FBX Exporter

Then I recieved a logged warning Nothing To Export. So I tried selecting the object in the hierarchy. I dragged my-asset.asset into the scene (I could have entered the values in and ran the renderer again but that would take more time), selected in the hierarchy, and tried to export as an FBX again. This worked! (The model was pink when it was dragged into the scene since there was no renderer or texture but this didn't matter as the export still worked).

I couldn't import an FBX file into Prusa Slicer so I first opened it up in Fusion 360 then exported as an STL. I clicked Upload then selected the FBX file. I then clicked File > Export as an STL and it worked! It took a long time to export because it was over 17,000 triangles.

Upload FBX

Note that the Unity Project was too large to upload to GitLab but I follow the exact instructions in this documentation to duplicate my project.

Slicing And Printing

I opened my file in Prusa Slicer, set the infil to 20% and quality to 0.20mm SPEED and lowered the x-scale factor to 15. This created a print time of ~1 hour. When I exported the GCODE and tried to run the print, I got very strange results on the first layer and had a feeling something was wrong.

Lumpy Layer 1

So, I stopped the print and ran the First Layer Calibration test, which gave similar results. I played around with adjusting the z offset but quickly realized that the problem was with the extruder and not the nozzel placement because filament was being extruded slowly in chuncks.

I tried unloading the filament, but this didn't work! So I turned off the printer, unplugged it, unscrewed the filament connector between the extruder and the extruder motor, and disassembled the extruder motor. Using the 3D printer maintenance skills I also learned this week, I used a pick to clean out the teeth of the extruder gear as well as a bearing.

Connector Gold Bolt

Gold Bolt Removed

Teeth

Bearing

I then reassembled the piece but noticed that the filament wasn't getting stuck in the middle, so I pushed it to go all the way through and it did.

Assembly With Arrow

I wasn't able to get the filament out of the extruder so I turned the printer back and selected the Purge Filament option. Then I was able to pull some of the filament out of the extruder. I noticed that the filament was very crumbly and concluded that since the filament had been loaded for a long time without any printing (since week 1) and it was very cold in the garage where I was keep it the filament dried out.

Filament Stripped In Extruder

Crumbly Filament

I reconnected the extruder and extruder motor and tried again to load filament but the filament got stuck and the motor was making a very loud sound so I stopped the process. I relatively forcibly removed the filament and noticed the top of it was squished.

Squished Filament 1

Squished Filament 2

I once again disassembled the extruder motor, took out the spring-loaded idler, and went back to the prusa instructions for putting it together. After following the steps very carefully and making sure I tighened everything the right amount based on the manual, the filament loaded and purged successfully! I also did a First Layer Calibration test which worked. However, when it was calibrating before extruding, the heatbed got stuck and wouldn't move outwards. I realized the wired got tangled with the power cord so I fixed it then it worked!

Successful Loading

Doing First Layer Test

First Layer Test Working

Success And Hero Shots

Then I set the print, and it worked! This design could not be easily made subtractively because of the detailed ridges on the inside of the cylinder.

First Layer Worked

Hero Shot 1

Hero Shot 2

Hero Shot 3