Keywords: mathematica 3d cg parametricplot3d texture torus 輪環 りんかん ドーナツ どーなつ 八芒星 はちぼうせい program プログラム code コード algorithm コード アルゴリズム geometric sculpture geometricsculpture shape geometry sculpture mapping テクスチャ マッピング 模様 もよう design pattern デザイン パターン graphic グラフィック グラフィクス structure 意匠 構造 symmetry 対称性 たいしょうせい シンメトリー 対称 たいしょう algorithm white background monochrome plant foliage tree organic pattern a = 4; (* center hole size of a torus *) b = 8; (* octa-torus *) c = 3; (* distance from the center of rotation *) d = 4; (* number of torus *) SetOptions[ParametricPlot3D, PlotRange -> Full, Mesh -> None, Boxed -> False, Axes -> None, PlotPoints -> 400, ImageSize -> 1000, PlotStyle -> Directive[Specularity[White, 30], Texture[Import["D:/tmp/71.jpg"]]], TextureCoordinateFunction -> ({#4, #5 b Pi} &), Lighting -> "Neutral"]; g[v_] := Sum[Cos[(2 k - 1) v]/(2 k - 1), {k, 4}]; x = (a - Cos[t] - Sin[b s]) g[s + Pi/(2 b)] + c; y = Sin[t] + c; z = (a - Cos[t] - Sin[b s]) Sin[s + Pi/(2 b)] + c; rot = Table[{x, y, z}.RotationMatrix[2 i Pi/d, {0, 0, 1}], {i, d}]; ParametricPlot3D[rot, {t, 0, 2 Pi}, {s, 0, 2 Pi}] (*--- The Texture The g[] is a 4-partial sum of the Fourier series for Square wave. g[]は矩形波のフーリエ展開の最初の4項 *) a = 4; (* center hole size of a torus *) b = 8; (* octa-torus *) c = 3; (* distance from the center of rotation *) d = 4; (* number of torus *) SetOptions[ParametricPlot3D, PlotRange -> Full, Mesh -> None, Boxed -> False, Axes -> None, PlotPoints -> 400, ImageSize -> 1000, PlotStyle -> Directive[Specularity[White, 30], Texture[Import["D:/tmp/71.jpg"]]], TextureCoordinateFunction -> ({#4, #5 b Pi} &), Lighting -> "Neutral"]; g[v_] := Sum[Cos[(2 k - 1) v]/(2 k - 1), {k, 4}]; x = (a - Cos[t] - Sin[b s]) g[s + Pi/(2 b)] + c; y = Sin[t] + c; z = (a - Cos[t] - Sin[b s]) Sin[s + Pi/(2 b)] + c; rot = Table[{x, y, z}.RotationMatrix[2 i Pi/d, {0, 0, 1}], {i, d}]; ParametricPlot3D[rot, {t, 0, 2 Pi}, {s, 0, 2 Pi}] (*--- The Texture The g[] is a 4-partial sum of the Fourier series for Square wave. g[]は矩形波のフーリエ展開の最初の4項 *) |