1
$\begingroup$

For example:A Cuboctahedron is a polyhedron with 14 faces: 8 triangular faces and 6 square faces. It is one of the Archimedean solids and can be constructed by truncating either a cube or an octahedron at their vertices such that the remaining edges are all the same length.

What methods can Mathematica use to understand the composition of these classic flat bodies, the types of polygons they consist of, and how many of each type there are?

PolyhedronData["Cuboctahedron", {"EdgeCount", "FaceCount", 
  "VertexCount", "VertexCoordinates"}]

enter image description here

My personal attempt only resulted in finding out that it is composed of a total of 14 faces.

How to get 8 triangular faces and 6 square faces?

$\endgroup$
0

2 Answers 2

8
$\begingroup$
indexes = PolyhedronData["Cuboctahedron", "FaceIndices"];
pts = PolyhedronData["Cuboctahedron", "VertexCoordinates"];
groups = GatherBy[indexes, Length]
Graphics3D[Thread[{{Red, Blue}, Polygon[pts, #] & /@ groups}]]

{{{4, 10, 8, 2}, {3, 9, 11, 5}, {9, 6, 8, 12}, {3, 1, 2, 6}, {5, 7, 4, 1}, {11, 12, 10, 7}}, {{12, 11, 9}, {3, 5, 1}, {6, 9, 3}, {5, 11, 7}, {8, 10, 12}, {1, 4, 2}, {2, 8, 6}, {7, 10, 4}}}

enter image description here

$\endgroup$
3
$\begingroup$

According to LouisB's comment, using the Length and Tally functions can solve this problem.

list = PolyhedronData["Cuboctahedron", "FaceIndices"]
Length /@ list
Tally[Length /@ list]


(*{{4,6},{3,8}}*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.