Skip to content

Instantly share code, notes, and snippets.

@Harshapriya123
Created January 29, 2021 11:26
Show Gist options
  • Save Harshapriya123/7ccd6e177b377378fded48e9d9e96ab0 to your computer and use it in GitHub Desktop.
Save Harshapriya123/7ccd6e177b377378fded48e9d9e96ab0 to your computer and use it in GitHub Desktop.
Exception occurred in traits notification handler for object: <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E0BE9648>
C:\WINDOWS\system32>python C:\Users\harsha\Anaconda3\etc\keras\load_config.py 1>temp.txt
The process cannot access the file because it is being used by another process.
C:\WINDOWS\system32>set /p KERAS_BACKEND= 0<temp.txt
C:\WINDOWS\system32>del temp.txt
C:\WINDOWS\system32\temp.txt
The process cannot access the file because it is being used by another process.
C:\WINDOWS\system32>python -c "import keras" 1>nul 2>&1
C:\WINDOWS\system32>if errorlevel 1 (
ver 1>nul
set "KERAS_BACKEND=theano"
python -c "import keras" 1>nul 2>&1
)
(base) C:\WINDOWS\system32>pip install numpy --upgrade --ignore-installed
Collecting numpy
Downloading numpy-1.19.5-cp37-cp37m-win_amd64.whl (13.2 MB)
|████████████████████████████████| 13.2 MB 244 kB/s
Installing collected packages: numpy
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\users\\harsha\\anaconda3\\Lib\\site-packages\\numpy\\core\\_multiarray_tests.cp37-win_amd64.pyd'
Consider using the `--user` option or check the permissions.
(base) C:\WINDOWS\system32>pip install numpy --user
Requirement already satisfied: numpy in c:\users\harsha\anaconda3\lib\site-packages (1.16.5)
(base) C:\WINDOWS\system32>pip install numpy --upgrade
Requirement already satisfied: numpy in c:\users\harsha\anaconda3\lib\site-packages (1.16.5)
Collecting numpy
Using cached numpy-1.19.5-cp37-cp37m-win_amd64.whl (13.2 MB)
Installing collected packages: numpy
Attempting uninstall: numpy
Found existing installation: numpy 1.16.5
Uninstalling numpy-1.16.5:
Successfully uninstalled numpy-1.16.5
Successfully installed numpy-1.19.5
(base) C:\WINDOWS\system32>mayavi2
ERROR|2021-01-29 11:01:44,818|Exception occurred in traits notification handler for object: <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E0BE9648>, trait: preferences, old value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213DB3D3A68>, new value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213E0BA8B28>
Traceback (most recent call last):
File "C:\Users\harsha\Anaconda3\lib\site-packages\traits\trait_notifiers.py", line 340, in __call__
self.handler(*args)
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 81, in _preferences_changed
self._preferences_changed_listener, self._get_path()
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 112, in _get_path
raise SystemError('no preferences path, %s' % self)
SystemError: no preferences path, <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E0BE9648>
ERROR|2021-01-29 11:03:25,006|Exception occurred in traits notification handler for object: <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E15F1EE8>, trait: preferences, old value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213DB3D3A68>, new value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213E15F1E88>
Traceback (most recent call last):
File "C:\Users\harsha\Anaconda3\lib\site-packages\traits\trait_notifiers.py", line 340, in __call__
self.handler(*args)
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 81, in _preferences_changed
self._preferences_changed_listener, self._get_path()
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 112, in _get_path
raise SystemError('no preferences path, %s' % self)
SystemError: no preferences path, <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E15F1EE8>
ERROR|2021-01-29 11:03:25,914|Exception occurred in traits notification handler for object: <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E0BA5048>, trait: preferences, old value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213DB3D3A68>, new value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213E0BD9EE8>
Traceback (most recent call last):
File "C:\Users\harsha\Anaconda3\lib\site-packages\traits\trait_notifiers.py", line 340, in __call__
self.handler(*args)
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 81, in _preferences_changed
self._preferences_changed_listener, self._get_path()
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 112, in _get_path
raise SystemError('no preferences path, %s' % self)
SystemError: no preferences path, <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E0BA5048>
ERROR|2021-01-29 11:03:26,985|Exception occurred in traits notification handler for object: <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E0BD9DC8>, trait: preferences, old value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213DB3D3A68>, new value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213DFC58168>
Traceback (most recent call last):
File "C:\Users\harsha\Anaconda3\lib\site-packages\traits\trait_notifiers.py", line 340, in __call__
self.handler(*args)
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 81, in _preferences_changed
self._preferences_changed_listener, self._get_path()
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 112, in _get_path
raise SystemError('no preferences path, %s' % self)
SystemError: no preferences path, <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E0BD9DC8>
ERROR|2021-01-29 11:03:27,760|Exception occurred in traits notification handler for object: <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213DFC78168>, trait: preferences, old value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213DB3D3A68>, new value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213DFC783A8>
Traceback (most recent call last):
File "C:\Users\harsha\Anaconda3\lib\site-packages\traits\trait_notifiers.py", line 340, in __call__
self.handler(*args)
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 81, in _preferences_changed
self._preferences_changed_listener, self._get_path()
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 112, in _get_path
raise SystemError('no preferences path, %s' % self)
SystemError: no preferences path, <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213DFC78168>
ERROR|2021-01-29 11:03:40,564|Exception occurred in traits notification handler for object: <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E0830A08>, trait: preferences, old value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213DB3D3A68>, new value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213E0830C48>
Traceback (most recent call last):
File "C:\Users\harsha\Anaconda3\lib\site-packages\traits\trait_notifiers.py", line 340, in __call__
self.handler(*args)
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 81, in _preferences_changed
self._preferences_changed_listener, self._get_path()
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 112, in _get_path
raise SystemError('no preferences path, %s' % self)
SystemError: no preferences path, <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E0830A08>
ERROR|2021-01-29 11:03:41,377|Exception occurred in traits notification handler for object: <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E08AB048>, trait: preferences, old value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213DB3D3A68>, new value: <apptools.preferences.scoped_preferences.ScopedPreferences object at 0x00000213E08AB2E8>
Traceback (most recent call last):
File "C:\Users\harsha\Anaconda3\lib\site-packages\traits\trait_notifiers.py", line 340, in __call__
self.handler(*args)
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 81, in _preferences_changed
self._preferences_changed_listener, self._get_path()
File "C:\Users\harsha\Anaconda3\lib\site-packages\apptools\preferences\preferences_helper.py", line 112, in _get_path
raise SystemError('no preferences path, %s' % self)
SystemError: no preferences path, <apptools.preferences.ui.preferences_page.PreferencesPage object at 0x00000213E08AB048>
Qt: Untested Windows version 10.0 detected!
Qt: Untested Windows version 10.0 detected!
ERROR|2021-01-29 11:05:38,161|'NoneType' object has no attribute 'run_line_magic'
Traceback (most recent call last):
File "C:\Users\harsha\Anaconda3\lib\site-packages\mayavi\action\save_load.py", line 118, in perform
open(dialog.path).read(), dialog.path, 'exec'), g, g
File "C:/Users/harsha/Downloads/GUI/NEW.py", line 7, in <module>
get_ipython().run_line_magic('gui', 'qt')
AttributeError: 'NoneType' object has no attribute 'run_line_magic'
ERROR|2021-01-29 11:21:45,433|'NoneType' object has no attribute 'run_line_magic'
Traceback (most recent call last):
File "C:\Users\harsha\Anaconda3\lib\site-packages\mayavi\action\save_load.py", line 118, in perform
open(dialog.path).read(), dialog.path, 'exec'), g, g
File "C:/Users/harsha/Downloads/GUI/NEW.py", line 11, in <module>
get_ipython().run_line_magic('gui', 'qt')
AttributeError: 'NoneType' object has no attribute 'run_line_magic'
#!/usr/bin/env python
# coding: utf-8
# In[1]:
from IPython import get_ipython
import numpy as np
import matplotlib.pyplot as plt
from mayavi import mlab
from numpy import random
get_ipython().run_line_magic('gui', 'qt')
# In[2]:
from mayavi import mlab
# In[3]:
mlab.clf()
# In[4]:
import numpy as np
import pandas as pd
from numpy import *
# ## FLOOR
# In[5]:
s = np.ones((250,250))
im = mlab.imshow(s, colormap='Accent')
# ## CREATURE 2
# In[6]:
a, b = np.mgrid[0:pi:20j,0:2*pi:20j]
x=sin(a)*cos(b)*12
y=sin(a)*sin(b)*12
z=(cos(a)+3)*12
body1=mlab.mesh(x-60,y-40,z-1,color=(1,1,0))
# In[7]:
a, b = np.mgrid[0:pi:20j,0:2*pi:20j]
x=sin(a)*cos(b)*12
y=sin(a)*sin(b)*12
z=(cos(a)+2)*12
body2=mlab.mesh(x-60,y-40,z-2,color=(1,1,0))
# In[8]:
b,a = mgrid[0:2*pi:1000j, 0:2*pi:1000j]
r = 1.5
x= r * sin(a)*sin(b)*11
y=r *cos(a)*sin(b)*11
z=r * cos(b)*11
head1 = mlab.mesh(x-60,y-40,z+55,color=(0,1,0))
# In[9]:
x,y = mgrid[-3:3:100j,-3:3:100j]
z=sin(x*x+y*y)
hat = mlab.surf(x*10/2.5-60,y*10/2.5-40,z*10/1.5+65,color=(1,0.5,0))
# In[10]:
a,b = mgrid[0:pi*2:1000j, 0:pi*2:1000j]
r1 = 0.2*2.1
r2 = 0.3*2.1
x = r2* sin(a)*sin(b)*9
y=r2 *cos(a)*sin(b)*9
z=r2 * cos(b)*9
eye1 = mlab.mesh(x-65,y-53,z+55,color=(1,1,1))
# In[11]:
a,b = mgrid[0:pi*2:1000j, 0:pi*2:1000j]
r1 = 0.2*2.1
r2 = 0.3*2.1
x = r2* sin(a)*sin(b)*9
y=r2 *cos(a)*sin(b)*9
z=r2 * cos(b)*9
eye2 = mlab.mesh(x-55,y-53,z+55,color=(1,1,1))
# In[12]:
a,b = mgrid[0:pi*2:100j, 0:pi*2:100j]
r1 = 0.2*2.1
r2 = 0.3*2.1
x = r2* sin(a)*sin(b)*5
y=r2 *cos(a)*sin(b)*5
z=r2 * cos(b)*5
eyeball1 = mlab.mesh(x-65,y-57,z+55,color=(0,0,0))
# In[13]:
a,b = mgrid[0:pi*2:100j, 0:pi*2:100j]
r1 = 0.2*2.1
r2 = 0.3*2.1
x = r2* sin(a)*sin(b)*5
y=r2 *cos(a)*sin(b)*5
z=r2 * cos(b)*5
eyeball2 = mlab.mesh(x-54,y-57,z+55,color=(0,0,0))
# In[14]:
a,b = mgrid[0:pi*2:100j, 0:pi*2:100j]
r1 = 0.2*2.1
r2 = 0.3*2.1
x = r2* sin(a)*sin(b)*5
y=r2 *cos(a)*sin(b)*5
z=r2 * cos(b)*5
nose = mlab.mesh(x-60,y-57,z+50,color=(1,0,0))
# In[15]:
a,b = mgrid[0:pi*2:100j, 0:pi*2:100j]
r1 = 0.2*2.1
r2 = 0.3*2.1
x = r2* sin(a)*sin(b)*6
y=r2 *cos(a)*sin(b)*6
z=r2 * cos(b)*6
mouth = mlab.mesh(x-60,y-50,z+46,color=(0,0,0))
# In[16]:
t = linspace(-3.8,-1,30)
x = t*10
y = (2)*np.ones_like(t)*10
z = 4.25*np.ones_like(t)*10
hand1 = mlab.points3d(x-55,y-60,z-1,t*2,color = (1,1,1),scale_mode='none')
hand2 = mlab.points3d(x-17,y-60,z-1,t*2,color = (1,1,1),scale_mode='none')
# In[17]:
t=linspace(0,10*pi,1000)
x,y = 0.2*sin(t),0.2*cos(t)*10
z=0.1*t*10
h11=mlab.plot3d(x-65,y-40,z+65,t,color=(1,1,0),tube_radius=0.8)
h12=mlab.plot3d(x-54,y-40,z+65,t,color=(1,1,0),tube_radius=0.8)
#h13=mlab.points3d(x[-1]-65,y[-1]-40,z[-1]+55)
#h14=mlab.points3d(x[-1]-54,y[-1]-40,z[-1]+55)
# In[18]:
b,a = mgrid[0:2*pi:1000j, 0:2*pi:1000j]
r = 1.5
x= r * sin(a)*sin(b)*3
y=r *cos(a)*sin(b)*3
z=r * cos(b)*3
h13 = mlab.mesh(x-65,y-40,z+93,color=(1,1,1))
h14 = mlab.mesh(x-54,y-40,z+93,color=(1,1,1))
# In[19]:
t = linspace(-3.8,-1,20)
x = (2)*np.ones_like(t)*10
y = 4.25*np.ones_like(t)*10
z = t*10
leg11 = mlab.points3d(x-85,y-85,z+35,t*2,color = (1,1,1),scale_mode='none')
leg12 = mlab.points3d(x-74,y-85,z+35,t,color = (1,1,1),scale_mode='none')
# ## CREATURE 2
# In[20]:
u, v = mgrid[- 0.035:pi:0.01, - 0.035:pi:0.01]
X = 2 / 3. *10* (cos(u) * cos(2 * v)
+ sqrt(2) * sin(u) * cos(v)) * cos(u) / (sqrt(2) -
sin(2 * u) * sin(3 * v))
Y = 2 / 3. *10* (cos(u) * sin(2 * v) -
sqrt(2) * sin(u) * sin(v)) * cos(u) / (sqrt(2)
- sin(2 * u) * sin(3 * v))
Z = sqrt(2) * cos(u) * cos(u)*10 / (sqrt(2) - sin(2 * u) * sin(3 * v))
S = sin(u)*10
m=mlab.mesh(X+60, Y-60, Z+50, scalars=S, color=(1,0.5,0) )
# In[21]:
a,b = mgrid[-3:3:100j,-3:3:100j]
x=sin(a)*10
y=cos(b)*10
z=sin(a*a+b*b)*10
head2=mlab.mesh(x+60,y-60,z+45,color=(0.9,0.9,0.9))
# In[22]:
s,t = mgrid[0:pi*2:1000j, 0:pi*2:1000j]
r = 1.5*(0.6 + 0.3*sin(t))*11
x = r * cos(s)
y = r * sin(s)
z = 1.5*t*11/(2*pi)*1.75-3
body2 = mlab.mesh(x+60,y-60,z+15,color=(1,0,0))
# In[23]:
a,b = mgrid[0:pi*2:1000j, 0:pi*2:1000j]
r1 = 0.1*2*10
r2 = 0.2*2*10
x = r2* sin(a)*sin(b)
y=r2 *cos(a)*sin(b)
z=r2 * cos(b)
eye1 = mlab.mesh(x+55,y-70,z+50,color=(1,1,1))
# In[24]:
a,b = mgrid[0:pi*2:1000j, 0:pi*2:1000j]
r1 = 0.1*2*10
r2 = 0.2*2*10
x = r2* sin(a)*sin(b)
y=r2 *cos(a)*sin(b)
z=r2 * cos(b)
eye2 = mlab.mesh(x+65,y-70,z+50,color=(1,1,1))
# In[25]:
a,b = mgrid[0:pi*2:100j, 0:pi*2:100j]
r1 = 0.2*2.1
r2 = 0.3*2.1
x = r2* sin(a)*sin(b)*3
y=r2 *cos(a)*sin(b)*3
z=r2 * cos(b)*3
eyeball1 = mlab.mesh(x+55,y-73,z+50,color=(0,0,0))
# In[26]:
a,b = mgrid[0:pi*2:100j, 0:pi*2:100j]
r1 = 0.2*2.1
r2 = 0.3*2.1
x = r2* sin(a)*sin(b)*3
y=r2 *cos(a)*sin(b)*3
z=r2 * cos(b)*3
eyeball1 = mlab.mesh(x+65,y-73,z+50,color=(0,0,0))
# In[27]:
t = linspace(0,2*pi,200)
u = cos(t)*pi*10
x,y,z = sin(u)*10,cos(u)*10,sin(t)*10
bottom=mlab.plot3d(x+60,y-60,z+15,t*2,color=(1,1,1),tube_radius=1)
# In[28]:
t = linspace(0,2*pi,200)
u = cos(t)*pi
x,y,z = sin(u)*10,cos(u)*10,sin(t)*10
hands2=mlab.plot3d(x+60,y-60,z+25,t*2,color=(1,1,1),tube_radius=1)
# In[29]:
t=linspace(0,10*pi,1000)
x,y = 0.2*sin(t),0.2*cos(t)*10
z=0.1*t*10
leg21=mlab.plot3d(x+57,y-60,z-0.5,t*2,color=(1,1,0),tube_radius=1)
leg22=mlab.plot3d(x+63,y-60,z-0.5,t*2,color=(1,1,0),tube_radius=1)
# ## CREATURE 3
# In[30]:
dphi, dtheta = np.pi / 250.0, np.pi / 250.0
[phi, theta] = np.mgrid[0:np.pi + dphi * 1.5:dphi,0:2 * np.pi + dtheta * 1.5:dtheta]
x = 1.5*np.sin(phi) * np.cos(theta)*10
y = 1.5* np.sin(phi) * np.sin(theta)*10
z = 3*np.cos(phi)*10
body3=mlab.mesh(x+30,y ,z+40 , color = (0,0,1))
# In[31]:
t = linspace(-3.8,-1,5)
x = t*4*5
y = (2)*np.ones_like(t)*10
z = 4.25*np.ones_like(t)*10
hand31 = mlab.plot3d(x+77,y-20,z+10,5*2*x,color = (1,1,1),tube_radius=2.5)
# In[32]:
n = 8
t = np.linspace(-np.pi, np.pi, n)
z = np.exp(1j * t)
x = z.real.copy()
y = z.imag.copy()
z = np.zeros_like(x)
triangles = [(0, i, i + 1) for i in range(1, n)]
x = np.r_[0, x]
y = np.r_[0, y]
z = np.r_[1, z]
t = np.r_[0, t]
mlab.triangular_mesh(2*x*10+30, 2*y*10,2*z*10, triangles, scalars=t,color = (1,1,1))
# In[33]:
b,a = mgrid[0:2*pi:1000j, 0:2*pi:1000j]
r = 1.5*10
x= r * sin(a)*sin(b)
y=r *cos(a)*sin(b)
z=r * cos(b)
head3 = mlab.mesh(x+30,y,z+80,color=(0,1,1))
# In[34]:
a,b = mgrid[0:pi*2:1000j, 0:pi*2:1000j]
r1 = 0.25*2.1
r2 = 0.35*2.1
x = r2* sin(a)*sin(b)*11
y=r2 *cos(a)*sin(b)*11
z=r2 * cos(b)*11
eye3 = mlab.mesh(x+30,y-10,z+80,color=(1,1,1))
# In[35]:
a,b = mgrid[0:pi*2:100j, 0:pi*2:100j]
r1 = 0.2*2
r2 = 0.2*2
x = r2* sin(a)*sin(b)*10
y=r2 *cos(a)*sin(b)*10
z=r2 * cos(b)*10
eyeball3 = mlab.mesh(x+30,y-15,z+80,color=(0,0,0))
# ## CREATURE 4
# In[36]:
dphi, dtheta = pi/250.0, pi/250.0
[phi,theta] = mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;
r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + sin(m4*theta)**m5 + cos(m6*theta)**m7
x = r*sin(phi)*cos(theta)
y = r*sin(phi)*sin(theta)
z = r*cos(phi)
body4 = mlab.mesh(x*12-30, y*12-5, z*12+25,color = (0.5,0,0.5))
# In[37]:
dphi, dtheta = np.pi / 250.0, np.pi / 250.0
[phi, theta] = np.mgrid[0:np.pi + dphi * 1.5:dphi,
0:2 * np.pi + dtheta * 1.5:dtheta]
x = np.sin(phi)/3 * np.cos(theta)/3
z = 3*np.cos(phi)/3
y = np.sin(phi)/3 * np.sin(theta)/3
mlab.mesh(x*12-40,y*12-5,z*12+38 , color = (1,1,1))
# In[38]:
dphi, dtheta = np.pi / 250.0, np.pi / 250.0
[phi, theta] = np.mgrid[0:np.pi + dphi * 1.5:dphi,
0:2 * np.pi + dtheta * 1.5:dtheta]
x = np.sin(phi)/3 * np.cos(theta)/3
z = 3*np.cos(phi)/3
y = np.sin(phi)/3 * np.sin(theta)/3
mlab.mesh(x*12-21,y*12-5,z*12+38 , color = (1,1,1))
# In[39]:
b,a = mgrid[0:2*pi:1000j, 0:2*pi:1000j]
r = 10
x= r * sin(a)*sin(b)
y=r *cos(a)*sin(b)
z=r * cos(b)
head4 = mlab.mesh(x-30,y-5,z+55,color=(1,1,1))
# In[40]:
a,b = mgrid[0:pi*2:1000j, 0:pi*2:1000j]
r1 = 0.2*1.5
r2 = 0.3*1.5*10
x = r2* sin(a)*sin(b)
y=r2 *cos(a)*sin(b)
z=r2 * cos(b)
eye1 = mlab.mesh(x-35,y-12,z+60,color=(0,0,0))
# In[41]:
a,b = mgrid[0:pi*2:1000j, 0:pi*2:1000j]
r1 = 0.2*1.5
r2 = 0.3*1.5*10
x = r2* sin(a)*sin(b)
y=r2 *cos(a)*sin(b)
z=r2* cos(b)
eye2 = mlab.mesh(x-25,y-12,z+60,color=(0,0,0))
# In[42]:
a,b = mgrid[0:pi*2:100j, 0:pi*2:100j]
r1 = 0.1*2
r2 = 0.1*2
x = r2* sin(a)*sin(b)*12
y=r2 *cos(a)*sin(b)*12
z=r2 * cos(b)*12
eyeball1 = mlab.mesh(x-35,y-15,z+60,color=(1,1,1))
# In[43]:
a,b = mgrid[0:pi*2:100j, 0:pi*2:100j]
r1 = 0.1*2
r2 = 0.1*2
x = r2* sin(a)*sin(b)*12
y=r2 *cos(a)*sin(b)*12
z=r2 * cos(b)*12
eyeball2 = mlab.mesh(x-25,y-15,z+60,color=(1,1,1))
# ## MUSHROOM
# In[44]:
for i in range(10):
for j in range(10):
x0 = 10 * (i-5)
z0 = 10 * j-5
y0 = sqrt(3000- x0*x0)
#top
phi1=np.linspace(0, 2 * np.pi, 100)
theta1=arccos(np.linspace(0,1,20))
for k in range(15):
x_pol = np.cos(phi1) * np.cos(theta1[k])*5
y_pol = np.sin(phi1) * np.cos(theta1[k])*5
z_pol = np.ones_like(phi1) * np.sin(theta1[k])*5
mlab.points3d(x_pol+x0+10, y_pol+y0, z_pol+z0+20, color=(1,0,0))
#bottom
s,t = mgrid[0:pi*2:100j, 0:pi*2:100j]
r = (0.5 - 0.2*sin(t/2))*5
x = r* cos(s)
y = r * sin(s)
z= (t/(2*pi)*(1) + 1)*5
mush_stalk = mlab.mesh(x+x0+10,y+y0,z-1.2+z0+15,color=(1,1,1))
# In[45]:
## Create a sphere
r = 120.0
pi = np.pi
cos = np.cos
sin = np.sin
arccos=np.arccos
phi, theta = np.mgrid[0:pi/2:50j, 0:pi:10j]
x = r*sin(phi)*cos(theta)
y = r*sin(phi)*sin(theta)
z = r*cos(phi)
mlab.mesh(x-0.5 , y-0.5 , z, color=(1,0.,1), opacity=1)
# In[ ]:
phi1=np.linspace(0, np.pi/2, 10)
theta1=np.linspace(0, np.pi, 10)
for i in range(10):
x_pol = 120*np.sin(phi1) * np.cos(theta1[i])
y_pol = 120*np.sin(phi1) * np.sin(theta1[i])
z_pol = 120*np.cos(phi1)
mlab.plot3d(x_pol-0.5, y_pol-0.5, z_pol, color=(0.9,0.9,0), opacity=1, tube_radius=0.5)
mlab.show()
# In[ ]:
x=2
y=2
x+y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment