{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import k3d\n", "import numpy as np\n", "\n", "plot = k3d.plot()\n", "\n", "o = np.stack([np.linspace(0,2,50),np.zeros(50),np.zeros(50)]).T.astype(np.float32)\n", "v = np.random.randn(50,3).astype(np.float32)\n", "vectors = k3d.vectors(o,v)\n", "plot += vectors\n", "\n", "plot.display()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# That will throw a error. \n", "# vectors.origins = o[::2]\n", "# vectors.vectors = v[::2]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "with vectors.hold_sync():\n", " vectors.origins = o[::2]\n", " vectors.vectors = v[::2]" ] }, { "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.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }