|
2 | 2 | "cells": [
|
3 | 3 | {
|
4 | 4 | "cell_type": "code",
|
5 |
| - "execution_count": 1, |
| 5 | + "execution_count": null, |
6 | 6 | "metadata": {
|
7 | 7 | "collapsed": true
|
8 | 8 | },
|
|
24 | 24 | },
|
25 | 25 | {
|
26 | 26 | "cell_type": "code",
|
27 |
| - "execution_count": 2, |
| 27 | + "execution_count": null, |
28 | 28 | "metadata": {},
|
29 |
| - "outputs": [ |
30 |
| - { |
31 |
| - "data": { |
32 |
| - "application/vnd.jupyter.widget-view+json": { |
33 |
| - "model_id": "5a0317efcb07469392f4d41f1dad3b59" |
34 |
| - } |
35 |
| - }, |
36 |
| - "metadata": {}, |
37 |
| - "output_type": "display_data" |
38 |
| - } |
39 |
| - ], |
| 29 | + "outputs": [], |
40 | 30 | "source": [
|
41 | 31 | "ball = Mesh(geometry=SphereGeometry(radius=1), \n",
|
42 | 32 | " material=LambertMaterial(color='red'),\n",
|
|
56 | 46 | },
|
57 | 47 | {
|
58 | 48 | "cell_type": "code",
|
59 |
| - "execution_count": 3, |
| 49 | + "execution_count": null, |
60 | 50 | "metadata": {
|
61 | 51 | "collapsed": true
|
62 | 52 | },
|
|
67 | 57 | },
|
68 | 58 | {
|
69 | 59 | "cell_type": "code",
|
70 |
| - "execution_count": 4, |
| 60 | + "execution_count": null, |
71 | 61 | "metadata": {
|
72 | 62 | "collapsed": true
|
73 | 63 | },
|
|
91 | 81 | },
|
92 | 82 | {
|
93 | 83 | "cell_type": "code",
|
94 |
| - "execution_count": 5, |
| 84 | + "execution_count": null, |
95 | 85 | "metadata": {
|
96 | 86 | "scrolled": true
|
97 | 87 | },
|
98 |
| - "outputs": [ |
99 |
| - { |
100 |
| - "data": { |
101 |
| - "application/vnd.jupyter.widget-view+json": { |
102 |
| - "model_id": "dbbdb66ec0214df4ae0a2b8af5f483a5" |
103 |
| - } |
104 |
| - }, |
105 |
| - "metadata": {}, |
106 |
| - "output_type": "display_data" |
107 |
| - }, |
108 |
| - { |
109 |
| - "data": { |
110 |
| - "application/vnd.jupyter.widget-view+json": { |
111 |
| - "model_id": "4149a2737a234f1db7c3813346685f5e" |
112 |
| - } |
113 |
| - }, |
114 |
| - "metadata": {}, |
115 |
| - "output_type": "display_data" |
116 |
| - } |
117 |
| - ], |
| 88 | + "outputs": [], |
118 | 89 | "source": [
|
119 | 90 | "nx, ny = (20, 20)\n",
|
120 | 91 | "xmax=1\n",
|
|
162 | 133 | },
|
163 | 134 | {
|
164 | 135 | "cell_type": "code",
|
165 |
| - "execution_count": 6, |
| 136 | + "execution_count": null, |
166 | 137 | "metadata": {
|
167 | 138 | "collapsed": true
|
168 | 139 | },
|
|
182 | 153 | },
|
183 | 154 | {
|
184 | 155 | "cell_type": "code",
|
185 |
| - "execution_count": 7, |
| 156 | + "execution_count": null, |
186 | 157 | "metadata": {},
|
187 |
| - "outputs": [ |
188 |
| - { |
189 |
| - "data": { |
190 |
| - "application/vnd.jupyter.widget-view+json": { |
191 |
| - "model_id": "82d74882be1a40abaa66bc448cd47ae1" |
192 |
| - } |
193 |
| - }, |
194 |
| - "metadata": {}, |
195 |
| - "output_type": "display_data" |
196 |
| - } |
197 |
| - ], |
| 158 | + "outputs": [], |
198 | 159 | "source": [
|
199 | 160 | "import numpy as np\n",
|
200 | 161 | "from scipy import ndimage\n",
|
|
238 | 199 | },
|
239 | 200 | {
|
240 | 201 | "cell_type": "code",
|
241 |
| - "execution_count": 8, |
| 202 | + "execution_count": null, |
242 | 203 | "metadata": {},
|
243 |
| - "outputs": [ |
244 |
| - { |
245 |
| - "data": { |
246 |
| - "application/vnd.jupyter.widget-view+json": { |
247 |
| - "model_id": "0912fdee6b9f492e9f0d20d410b7fd66" |
248 |
| - } |
249 |
| - }, |
250 |
| - "metadata": {}, |
251 |
| - "output_type": "display_data" |
252 |
| - } |
253 |
| - ], |
| 204 | + "outputs": [], |
254 | 205 | "source": [
|
255 | 206 | "# On windows, linewidth of the material has no effect\n",
|
256 | 207 | "size = 4\n",
|
|
260 | 211 | " [0, size, 0],\n",
|
261 | 212 | " [0, 0, 0],\n",
|
262 | 213 | " [0, 0, size]],\n",
|
263 |
| - " faces=[[0,1,2],[2,3,1]],\n", |
264 | 214 | " colors = ['red', 'red', 'green', 'green', 'white', 'orange'])\n",
|
265 |
| - "lines = Mesh(geometry=linesgeom, \n", |
266 |
| - " material=BasicMaterial(linewidth=5, vertexColors='VertexColors'), \n", |
| 215 | + "lines = Line(geometry=linesgeom, \n", |
| 216 | + " material=LineBasicMaterial(linewidth=5, vertexColors='VertexColors'), \n", |
267 | 217 | " type='LinePieces')\n",
|
268 | 218 | "scene = Scene(children=[lines, DirectionalLight(color='#ccaabb', position=[0,10,0]),AmbientLight(color='#cccccc')])\n",
|
269 | 219 | "c = PerspectiveCamera(position=[0, 10, 10])\n",
|
270 |
| - "renderer = Renderer(camera=c, scene = scene, controls=[OrbitControls(controlling=c)])\n", |
| 220 | + "renderer = Renderer(camera=c, background='black', background_opacity=1, scene = scene, controls=[OrbitControls(controlling=c)])\n", |
271 | 221 | "display(renderer)"
|
272 | 222 | ]
|
273 | 223 | },
|
|
285 | 235 | },
|
286 | 236 | {
|
287 | 237 | "cell_type": "code",
|
288 |
| - "execution_count": 9, |
| 238 | + "execution_count": null, |
289 | 239 | "metadata": {},
|
290 |
| - "outputs": [ |
291 |
| - { |
292 |
| - "data": { |
293 |
| - "application/vnd.jupyter.widget-view+json": { |
294 |
| - "model_id": "59e7bbdd8d70458f8fdb9cc94750f1c8" |
295 |
| - } |
296 |
| - }, |
297 |
| - "metadata": {}, |
298 |
| - "output_type": "display_data" |
299 |
| - } |
300 |
| - ], |
| 240 | + "outputs": [], |
301 | 241 | "source": [
|
302 | 242 | "f = \"\"\"\n",
|
303 | 243 | "function f(origu,origv) {\n",
|
|
336 | 276 | },
|
337 | 277 | {
|
338 | 278 | "cell_type": "code",
|
339 |
| - "execution_count": 11, |
| 279 | + "execution_count": null, |
340 | 280 | "metadata": {},
|
341 |
| - "outputs": [ |
342 |
| - { |
343 |
| - "data": { |
344 |
| - "application/vnd.jupyter.widget-view+json": { |
345 |
| - "model_id": "a8630625d64d4f3f82d1a707b97d809d" |
346 |
| - } |
347 |
| - }, |
348 |
| - "metadata": {}, |
349 |
| - "output_type": "display_data" |
350 |
| - } |
351 |
| - ], |
| 281 | + "outputs": [], |
352 | 282 | "source": [
|
353 | 283 | "from pythreejs import *\n",
|
354 | 284 | "import numpy as np\n",
|
|
406 | 336 | },
|
407 | 337 | {
|
408 | 338 | "cell_type": "code",
|
409 |
| - "execution_count": 13, |
| 339 | + "execution_count": null, |
410 | 340 | "metadata": {},
|
411 |
| - "outputs": [ |
412 |
| - { |
413 |
| - "data": { |
414 |
| - "application/vnd.jupyter.widget-view+json": { |
415 |
| - "model_id": "7ab6910f90c24b52bfc1a9146e55f948" |
416 |
| - } |
417 |
| - }, |
418 |
| - "metadata": {}, |
419 |
| - "output_type": "display_data" |
420 |
| - } |
421 |
| - ], |
| 341 | + "outputs": [], |
422 | 342 | "source": [
|
423 | 343 | "from pythreejs import *\n",
|
424 | 344 | "import numpy as np\n",
|
|
0 commit comments