I am using the following POV-Ray loop to plot sRGB coordinates in other color spaces. The loop only generates points along the outer surface, and then connects them with triangles. Since the sRGB space is a sort of twisted cube, that means 6 outer faces and 8 vertices.
#macro cie_calc_gamut_xyz_srgb()
#for (i, 0, cie_sample_count_srgb)
#for (j, 0, cie_sample_count_srgb)
// side 0 & 3
#local cooRGB = <i/cie_sample_count_srgb,j/cie_sample_count_srgb,0>;
#local cooXYZ = cie_convRGB2XYZ(cooRGB);
#declare cie_point_array_srgb[0][i][j] = cooXYZ;
#local cooRGB = <i/cie_sample_count_srgb,j/cie_sample_count_srgb,1>;
#local cooXYZ = cie_convRGB2XYZ(cooRGB);
#declare cie_point_array_srgb[3][i][j] = cooXYZ;
// side 1 & 4
#local cooRGB = <i/cie_sample_count_srgb,0,j/cie_sample_count_srgb>;
#local cooXYZ = cie_convRGB2XYZ(cooRGB);
#declare cie_point_array_srgb[1][i][j] = cooXYZ;
#local cooRGB = <i/cie_sample_count_srgb,1,j/cie_sample_count_srgb>;
#local cooXYZ = cie_convRGB2XYZ(cooRGB);
#declare cie_point_array_srgb[4][i][j] = cooXYZ;
// side 2 & 5
#local cooRGB = <0,i/cie_sample_count_srgb,j/cie_sample_count_srgb>;
#local cooXYZ = cie_convRGB2XYZ(cooRGB);
#declare cie_point_array_srgb[2][i][j] = cooXYZ;
#local cooRGB = <1,i/cie_sample_count_srgb,j/cie_sample_count_srgb>;
#local cooXYZ = cie_convRGB2XYZ(cooRGB);
#declare cie_point_array_srgb[5][i][j] = cooXYZ;
#end
#end
#end
This works well, since nearly all color spaces are three-dimensional. Here is an example of the output:
However, I want to do the same with the CMYK color space. The problem I am encountering is that it has 4 parameters instead of 3. Again, I only want to plot points on the outermost surface and connect them with triangles. I do not think the resulting color solid is four-dimensional, but I am at a total loss as to how to proceed. Does anyone have a clue what to do? Thanks.
Note that XYZ is a color space. Link.