# How to retrieve the primitive unit of tilings as computable data?

Posted 5 months ago
612 Views
|
|
8 Total Likes
|
 Wolfram|Alpha knows about lots of periodic tilings, e.g. hexgonal. Most of the information it displays is accessible though Mathematica's entities. Entity["PeriodicTiling", "HexagonalTiling"]["Dataset"] But the primitive cell is missing, even though W|A clearly knows it.How can I get this information as computable data inside Mathematica? I can't find it among entities, and I can't seem to retrive it using WolframAlpha either. It gives me Missing["NoRawData"]. Try e.g. WolframAlpha["tiling primitive unit", {{"Result", 1}, "ComputableData"}, PodStates -> {"Result__More"}], which is generated by the W|A UI displayed in the notebook.
 I managed to extract the primitive cell data as follows:Find out the exact name of the tiling, e.g. by finding the entity, and getting it's "Name" property. For example, name = "trihexagonal tiling"; Now if we type == trihexagonal tiling, click the + in the Primitive unit subpod, and choose Computable data, we only get Missing[]. I suspect this is an oversight and not an intentional limitation, but I'm unsure. All the other subpods are available as computable data. So instead we get it as "Subpod content".This gives us WolframAlpha["trihexagonal tiling", {{"PrimitiveUnit", 1}, "Content"}], which returns a RawBoxes expression that needs to be interpreted.We can do this, and extract the actual polygons from the graphics, like this: In[944]:= name = "trihexagonal tiling"; In[945]:= Cases[ ToExpression@ First@WolframAlpha[name, {{"PrimitiveUnit", 1}, "Content"}], GeometricTransformation[polys_, ___] :> polys, Infinity, 1 ] Out[945]= {{Polygon[{{1/2, Sqrt[3]/2}, {1, 0}, {1/ 2, -(Sqrt[3]/2)}, {-(1/2), -(Sqrt[3]/2)}, {-1, 0}, {-(1/2), Sqrt[ 3]/2}}], Polygon[{{1/2, Sqrt[3]/2}, {1, 0}, {3/2, Sqrt[3]/2}}], Polygon[{{1/2, -(Sqrt[3]/2)}, {1, 0}, {3/2, -(Sqrt[3]/2)}}]}}