{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import k3d\n", "import k3d.platonic as platonic\n", "import math\n", "\n", "plot = k3d.plot()\n", "\n", "meshes = [\n", " platonic.Dodecahedron().mesh,\n", " platonic.Cube().mesh,\n", " platonic.Icosahedron().mesh,\n", " platonic.Octahedron().mesh,\n", " platonic.Tetrahedron().mesh\n", "]\n", "\n", "colors = [0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff00ff]\n", "\n", "for i, obj in enumerate(meshes): \n", " rad = math.radians(i / len(meshes) * 360)\n", " radius = 3.5\n", " obj.transform.translation = [math.sin(rad) * radius, math.cos(rad) * radius, 0]\n", " obj.color = colors[i]\n", " plot += obj\n", "\n", "plot.display()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.5" } }, "nbformat": 4, "nbformat_minor": 2 }