# How to color specific faces of a polyhedron?

The following code helps me draw a polyhedron. I would like to color each triangular face in red and make the edges of the polyhedron thicker. I've looked at the post, but I'm still not sure how to do it.

   Show[Graphics3D[{Opacity[0.3], FaceForm[Blue],
PolyhedronData["SmallRhombicuboctahedron", "Faces"]}],
Boxed -> False]


## 5 Answers

Step for step:

polygons = PolyhedronData["SmallRhombicuboctahedron", "Polygons"];

cor = PolygonCoordinates /@ polygons;


Find positions of triangular faces:

pos = Flatten @ Position[Length /@ cor, 3]


{19, 20, 21, 22, 23, 24, 25, 26}

Color them:

polygons[[pos]] = {Red, polygons[[pos]]};

Graphics3D[{Opacity[0.5], FaceForm[
RGBColor[0, 0, 1]], EdgeForm[{Thickness[Large], GrayLevel[0]}], polygons}]


## Edit

faces = PolyhedronData["SmallRhombicuboctahedron", "Faces"];

faces /.
Polygon[pts_] :>
Insert [Polygon /@ GatherBy[pts, Length[#] == 3 &], Red,
2] // Graphics3D


## Original

We change the strucure of the data of the PolyhedronData["SmallRhombicuboctahedron", "Faces"] to get faces1 and faces2

faces = PolyhedronData["SmallRhombicuboctahedron", "Faces"];
faces1 =
faces /. Polygon[pts_] :> Polygon[Select[pts, Length@# == 3 &]];
faces2 =
faces /. Polygon[pts_] :> Polygon[Select[pts, Length@# > 3 &]];
Show[Graphics3D[faces2], Graphics3D[{Red, faces1}], Boxed -> False]


t = PolyhedronData["SmallRhombicuboctahedron", "Faces"];
polys = First@Normal@t;
cols = Scan[
If[Length@MeshPrimitives[#, 1] == 3, Sow@Red,
Sow@Lighter@Blue] &, polys] // Reap // Last // First;
edges = Scan[
If[Length@MeshPrimitives[#, 1] == 3, Sow@Thick, Sow@Thin] &,
polys] // Reap // Last // First;
Graphics3D[{
MapThread[{FaceForm[Opacity[0.7, #1]], EdgeForm[#2], #3} &, {cols,
edges, polys}]
}
, Boxed -> False
]


styles = FaceForm[Opacity[.5, #]] & /@ {Green, Orange};

PolyhedronData["SmallRhombicuboctahedron", "Graphics3D"] /.
p_Polygon :> Map[{styles[[5 - Length @ #]], Polygon @ #} &] @ First @ p


Show[Graphics3D[{Opacity[0.3], FaceForm[Red],
EdgeForm[Directive[Thick, Green]],
PolyhedronData["SmallRhombicuboctahedron", "Faces"]}],
Boxed -> False]