I see similar questions for lists and indexes and manipulating with Thread, MapIndexed,etc., but I do not see how to do a substitution.
I have a list of coordinates for a geometric object and a list of the vertices that make up the face of the geometric object which is simply the index to the coordinates list.
I broke them out for convenience initially thinking it would be simple to substitute the coordinates back into the vertices for the face.
I see several examples on mathematica documentation for MapIndexed, but don't understand how to apply them to this "substitution".
Any explanation and/or help would be appreciated. I have attached the sample code below.
groupedVerticesRT =
{
{
{ C4, C4, C4}, { C4, C4, -C4}, { C4, -C4, C4}, {
C4, -C4, -C4},
{-C4, C4, C4}, {-C4, C4, -C4}, {-C4, -C4, C4}, {-C4, -C4, -C4}
},
{
{0, C6, C5}, {0, C6, -C5}, {0, -C6, C5}, {0, -C6, -C5}
},
{
{C5, 0, C6}, {C5, 0, -C6}, {-C5, 0, C6}, {-C5, 0, -C6}
},
{
{C6, C5, 0}, {C6, -C5, 0}, {-C6, C5, 0}, {-C6, -C5, 0}
},
{
{0, C4, C6}, {0, C4, -C6}, {0, -C4, C6}, {0, -C4, -C6},
{C6, 0, C4}, {C6, 0, -C4}, {-C6, 0, C4}, {-C6, 0, -C4},
{C4, C6, 0}, {C4, -C6, 0}, {-C4, C6, 0}, {-C4, -C6, 0}
}
};
facesRT =
{
{13, 23, 15, 21}, {13, 23, 3, 25}, {13, 25, 1, 21}, {25, 18, 30,
3}, {25, 17, 29, 1},
{25, 18, 26, 17}, {18, 30, 4, 26}, {17, 26, 2, 29}, {29, 1, 21,
9}, {21, 5, 27, 15},
{15, 27, 7, 23}, {21, 9, 31, 5}, {5, 31, 19, 27}, {27, 20, 32,
7}, {27, 19, 28, 20},
{23, 7, 32, 11}, {23, 11, 30, 3}, {32, 20, 28, 8}, {11, 32, 12,
30}, {22, 14, 26, 2},
{19, 31, 6, 28}, {14, 24, 4, 26}, {9, 29, 10, 31}, {32, 8, 24,
12}, {12, 24, 4, 30},
{29, 2, 22, 10}, {10, 22, 6, 31}, {28, 16, 24, 8}, {28, 6, 22,
16}, {16, 22, 14, 24}
};
Edit: I would like to return something like the following using MapIndexed or something similar to substitute the coordinates into the list for the faces to generate one giant list that has a list of faces made up of a the list of their coordinates:
expandedRT =
{
{
{C5, 0, C6}, {0, -C4, C6}, {-C5, 0, C6}, {0, C4, C6} (* coordinates {13, 23, 15, 21} *)
}, (* face 1 *)
{
(* faces 2 - end *)
}
}