使用多面体作为图形基元,放置点和缩放

cor*_*ion 7 wolfram-mathematica

我可以问一个简单的初学者的问题,在我的任何一个文本中都无法找到一个易于理解的答案(在某些情况下,这些文本已经很老了,早于版本6)?你如何使用多面体,就好像它们是像Sphere和Cuboid这样的图形基元?即,以一个点为中心并缩放.以下是一些愚蠢的例子来说明这一点:

(* spheres along a path *)
data = Table[{Cos[t], Sin[t], Sin[t] Cos[2 t]}, {t, 0, 2 Pi, Pi/24}];
Graphics3D[Sphere[#, 0.3] & /@ data]
Run Code Online (Sandbox Code Playgroud)

球体循环

(* cubes along a path *)
Graphics3D[Cuboid[#, # + 0.1] & /@ data]
Run Code Online (Sandbox Code Playgroud)

多维数据集循环

那么如何将icosahedra置于特定的点和规模,写出类似的东西

Graphics3D[icosahedron[#, 0.1] & /@ data]
Run Code Online (Sandbox Code Playgroud)

编辑:我认为我的问题是如何制作GraphicsComplexGraphics3D合作.例如,我目前在哪里:

shapes[ct_, siz_] := {Sphere[ct - .2, siz ], Sphere[ct - 0.1, siz]};
Graphics3D[{{shapes[#, size] & /@ data}}]
Run Code Online (Sandbox Code Playgroud)

我想替换Sphere[]icosahedron[].我目前正试图让Heike的解决方案工作......

编辑2:现在工作正常,谢谢Heike.不确定我会不会得到它3D打印 - 看起来有点不舒服...

柏拉图式手镯

Hei*_*ike 13

你可以这样做:

icosahedron = PolyhedronData["Icosahedron"][[1]];
Graphics3D[Translate[Scale[icosahedron, .1], #] & /@ data]
Run Code Online (Sandbox Code Playgroud)

二十面体

  • @cormullion:`GraphicsComplex`被视为任何其他`Graphics`或`Graphics3D`原语,因此你可以定义`icosahedron [c _,s _]:= Translate [Scale [PolyhedronData ["Icosahedron"] [[1]],s] ,c]`. (2认同)