# Different color for Different Faces of Convex Hull

P0={0,0,0};P1={1,0,0};P2={0,1,0};P3={0,0,1};P4={1,1,1};P5={-1,-1,-1};
R[4]=ConvexHullMesh[{P0,P1,P3,P4},Frame->True,PlotRange -> Automatic,MeshCellStyle -> {{2,All}-> Opacity[.4, Red],{1,All}->Black,{0,All}->Blue}];

Show[Region[R[4], PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2},{-1.2,1.2}},
Axes-> True, ImageSize -> Large,AxesOrigin->{0,0,0},LabelStyle ->{12,Bold,Black},AxesLabel->{x,y,z},AxesStyle->Thick,Boxed->True]]


I have the following 3D convex hull. How can I give different colors to different faces of the convex hull?

Thank you

• "different sides" - you mean "different faces", yes? Apr 25, 2020 at 11:05
• Yes. Different faces. I will edit it. Thanks Apr 25, 2020 at 11:07

faces = MeshPrimitives[R[4], "Polygons"];
colors = {Red, Green, Blue, Orange};

Graphics3D[Transpose@{colors , faces},
PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}, {-1.2, 1.2}}, Axes -> True,
ImageSize -> Large, AxesOrigin -> {0, 0, 0},
LabelStyle -> {12, Bold, Black}, AxesLabel -> {x, y, z},
AxesStyle -> Thick, Boxed -> True]


• Thanks. Is it possible to change the opacity of the colors so that the we don't see the axis lines through the hull? Apr 25, 2020 at 11:22
• @Sumit, you can define colors as colors = Opacity[.5, #]& /@ {Red, Green, Blue, Orange}
– kglr
Apr 25, 2020 at 11:44
• Thanks a lot for your help. Apr 25, 2020 at 11:48
• @Sumit, my pleasure.
– kglr
Apr 25, 2020 at 11:51
• you can try something like Epilog -> {Inset[Style["text", 16, Red], {.5, .7}], Text[Style["text2", 16, Green], {.3, .4}]}
– kglr
Apr 25, 2020 at 12:09