Bringing Back the Bucky Ball

Bucky Ball提供了图形的优雅示例,即Buckminster Fuller Geodesic Dome的连通性。
我们还将与现场编辑一起演示发布此博客。帖子末尾有一个按钮,可以下载实时脚本,以便您可以在自己的计算机上运行动画。
您可能会在帖子末尾看到第二个按钮,该按钮允许Live脚本由MATLAB Online执行,并在浏览器中显示的结果。此功能仍在开发中,并且在某些浏览器中不起作用。

Bucky

The statement
B = bucky;
creates a sparse 60-by-60 matrix, the adjacency matrix of the connectivity graph for a geodesic dome, a soccer ball, a carbon-60 molecule or a truncated icosahedron. These objects all have 32 faces; 12 of them are pentagons and 20 are hexagons.

Spy

One view of this matrix is its spy 图,显示节点和边缘的逻辑结构。
spy(B)

Graph

To get other views, use the MATLAB graph object. The statement
G = graph(B);
makes a graph . 就图形本身而言,图没有任何几何结构。为了绘制它,您指定了 布局 , or coordinates, for the nodes. Coming up with good layouts is an art, as well as a science. There are currently six available layouts: 'circle', 'force', 'layered', 'subspace', 'force3' and 'subspace3'. Let's use 'force3'. This will give locate the nodes and edges of the graph in three dimensions. The resulting image is recognized anywhere on Earth as a standard football or soccer ball.
By the way, I am using the new assignment operator syntax for name-value pairs.
图(g,布局=“ force3”,线宽= 1.5)
正方形

History

The 帮助 条目 bucky ,
BUCKY Connectivity graph of the Buckminster Fuller geodesic dome.
B = BUCKY is the 60-by-60 sparse adjacency matrix of the
地球圆顶,足球的连接图,
和碳-60分子。
[B,V] = Bucky还返回顶点的XYZ坐标。
查看代码 bucky .
type bucky
30年前,当我们首次开发稀疏矩阵时,我写了这个功能。它几乎是一百行。现在看它,很难看到它的工作原理。大部分努力都用于放置顶点。我们不再需要坐标。与三维 Force3 布局, the graph/plot function does that work.

Bend It Like Beckham

Putting a little spin on a soccer ball makes it more interesting to watch. Place transparent patches on two of the pentagons.
k1 = 1:5;
k2 = 56:60;
colors = get(0,'defaultaxescolororder');
p =图(g,布局=“ force3”, markersize=3, nodefontsize=8, linewidth=1.5);
补丁(p.xdata(k1),p.ydata(k1),p.zdata(k1),颜色(2,:),chacealpha = 0.5);
patch(P.XData(k2),P.YData(k2),P.ZData(k2), colors(5,:), facealpha=0.5);
tight square off vis3d
Turn off the node numbering.
p.nodelabel = {};
让她走。在我的笔记本电脑上,完成此循环大约需要20秒。动画正在录制,最终出现了播放小部件。
tic
nframes = 120;
d = 360/nframes;
a = 0;
e = 0;
for帧= 1:nframes
view(a,e);
a = a -d;
e = e + d;
drawnow
end
view(a,e)
toc
经过的时间为16.221153秒。

谢谢

感谢Chench Chen,Bill York和Christine Tobler在这篇文章中的帮助。

To Be Continued

我没有解决这个问题。通过尝试代码,我一直在学到很多东西。我会回来我学到的东西。
In the meantime, try
  • Incrementaore独自的。
  • Removeoffandvis3d.
Some things to ponder,
  • Can you color two opposing hexagons instead of two pentagons?
  • 为什么节点标签和颜色有时会交换半球?
  • Is the hemisphere swapping a bug or a feature?
  • 在您看来,动画循环终止后,球仍在略微移动?
|

Comments

要发表评论,请单击这里登录您的数学帐户或创建一个新帐户。