public static SurfaceComponentGeometry CreateSphereCapGeometry(
        float radius, int segmentP, int segmentH, float angle = Mathf.PI, float cutAngle = 0, int surfaceGroup = 0, RenderGeometry.FaceType faceType = RenderGeometry.FaceType.Smooth,
        bool splitBoundary = false)
    {
        SurfaceComponentGeometry geometry = CreateFanCapGeometry(1, segmentP, segmentH, cutAngle, surfaceGroup, faceType, splitBoundary);

        Vector3 spherify(Vector3 pos, out Matrix4x4 localTransform)
        {
            float th  = pos.magnitude * angle / 2;
            float phi = Mathf.Atan2(pos.z, pos.x);

            Vector3 newPos = radius * new Vector3(Mathf.Sin(th) * Mathf.Cos(phi), Mathf.Cos(th), Mathf.Sin(th) * Mathf.Sin(phi));

            localTransform = Matrix4x4.Rotate(Quaternion.FromToRotation(Vector3.up, newPos));
            return(newPos);
        }

        geometry.ApplyPositionTransform(spherify);
        return(geometry);
    }