Skip to content
Browse files

Remodelling the xtk display code to be more general.

This version currently doesn't work because of a wierd XTK bug.
  • Loading branch information...
1 parent 7a17274 commit fe525c4b172d8c57cf049cca8d57c2d7dd568963 @ellisonbg committed Aug 9, 2012
Showing with 423 additions and 119 deletions.
  1. +237 −0 IPython/lib/xtk.py
  2. +0 −88 IPython/lib/xtkdisplay.py
  3. +186 −31 docs/examples/notebooks/xtk_display.ipynb
View
237 IPython/lib/xtk.py
@@ -0,0 +1,237 @@
+"""Display classes for the XTK JavaScript library.
+
+The XTK JavaScript library uses WebGL to render 3D visualizations. It can
+generate those visualizations based a range of standard 3D data files types,
+including .vtk and .stl. This module makes it possible to render these
+visualizations in the IPython Notebook.
+
+A simple example would be::
+
+ from IPython.lib.xtkdisplay import Mesh
+ Mesh('http://x.babymri.org/?skull.vtk', opacity=0.5, magicmode=True)
+
+Authors:
+
+* Brian Granger
+"""
+
+#-----------------------------------------------------------------------------
+# Copyright (C) 2012 The IPython Development Team
+#
+# Distributed under the terms of the BSD License. The full license is in
+# the file COPYING, distributed as part of this software.
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
+import os
+import uuid
+
+from IPython.display import Javascript, display
+
+#-----------------------------------------------------------------------------
+# Classes
+#-----------------------------------------------------------------------------
+
+
+def load_xtk():
+ js = 'alert("XTK library loaded");'
+ display(Javascript(js, lib='http://get.goXTK.com/xtk_edge.js'))
+
+
+class Base(object):
+
+ _xtk_name = 'base'
+
+ def __init__(self):
+ self.id = unicode(uuid.uuid4()).replace('-','')
+ self.var = 'obj_' + self.id
+
+
+
+_object_template = """
+ var %s = new X.%s();
+ %s.magicmode = %s;
+ %s.opacity = %f;
+ %s.color = [%f,%f,%f];
+"""
+
+class Object(Base):
+
+ _xtk_name = 'object'
+
+ def __init__(self, magicmode=False, opacity=1.0, color=(1.0,1.0,1.0)):
+ super(Object, self).__init__()
+ for value in (opacity,)+color:
+ if not isinstance(value, float):
+ raise TypeError('opacity and color values must be floats')
+ if value > 1.0 or value < 0.0:
+ raise ValueError('opacity and color values must be in the range [0.0,1.0]')
+ self.magicmode = 'true' if magicmode else 'false'
+ self.opacity = opacity
+ self.color = color
+
+ def generate_js_fragment(self):
+ return _object_template % (self.var, self._xtk_name, self.var, self.magicmode,
+ self.var, self.opacity, self.var, self.color[0], self.color[1], self.color[2])
+
+
+class Mesh(Object):
+
+ _xtk_name = 'mesh'
+
+ def __init__(self, url, magicmode=False, opacity=1.0, color=(1.0,1.0,1.0)):
+ super(Mesh,self).__init__(magicmode=magicmode, opacity=opacity, color=color)
+ self.url = url
+
+ def generate_js_fragment(self):
+ js = super(Mesh,self).generate_js_fragment()
+ js += ' %s.file = "%s";\n' % (self.var, self.url)
+ return js
+
+
+class Sphere(Object):
+
+ _xtk_name = 'sphere'
+
+ def __init__(self, center, radius, magicmode=False, opacity=1.0, color=(1.0,1.0,1.0)):
+ super(Sphere,self).__init__(magicmode=magicmode, opacity=opacity, color=color)
+ self.center = center
+ self.radius = radius
+
+ def generate_js_fragment(self):
+ js = super(Sphere,self).generate_js_fragment()
+ js += ' %s.center = [%f,%f,%f];\n' % (self.var, self.center[0], self.center[1], self.center[2])
+ js += ' %s.radius = %f;\n' % (self.var, self.radius)
+ return js
+
+
+class Cylinder(Object):
+
+ _xtk_name = 'cylinder'
+
+ def __init__(self, start, end, radius, magicmode=False, opacity=1.0, color=(1.0,1.0,1.0)):
+ super(Cylinder,self).__init__(magicmode=magicmode, opacity=opacity, color=color)
+ self.start = start
+ self.end = end
+ self.radius = radius
+
+ def generate_js_fragment(self):
+ js = super(Cylinder,self).generate_js_fragment()
+ js += ' %s.start = [%f,%f,%f];\n' % (self.var, self.start[0], self.start[1], self.start[2])
+ js += ' %s.end = [%f,%f,%f];\n' % (self.var, self.end[0], self.end[1], self.end[2])
+ js += ' %s.radius = %f;\n' % (self.var, self.radius)
+ return js
+
+
+class Cube(Object):
+
+ _xtk_name = 'cube'
+
+ def __init__(self, center, lengths, magicmode=False, opacity=1.0, color=(1.0,1.0,1.0)):
+ super(Cube,self).__init__(magicmode=magicmode, opacity=opacity, color=color)
+ self.center = center
+ self.lengths = lengths
+
+ def generate_js_fragment(self):
+ js = super(Cube,self).generate_js_fragment()
+ js += ' %s.center = [%f,%f,%f];\n' % (self.var, self.center[0], self.center[1], self.center[2])
+ js += ' %s.lengthX = %f;\n' % (self.var, self.lengths[0])
+ js += ' %s.lengthY = %f;\n' % (self.var, self.lengths[1])
+ js += ' %s.lengthZ = %f;\n' % (self.var, self.lengths[2])
+ return js
+
+
+_renderer3d_template = """
+ container.show();
+ var id = 'xtkwidget_' + utils.uuid();
+ var xtkdiv = $('<div/>').attr('id',id);
+ xtkdiv.css('background-color','%s').width(%i).height(%i);
+ element.append(xtkdiv);
+ var %s = new X.%s();
+ %s.container = id;
+ %s.init();
+"""
+
+
+class Renderer3D(Base):
+
+ _xtk_name = 'renderer3D'
+
+ def __init__(self, width=400, height=300, bgcolor='#000'):
+ super(Renderer3D,self).__init__()
+ self.width = width
+ self.height = height
+ self.bgcolor = bgcolor
+ self._objects = []
+
+ def add(self, o):
+ self._objects.append(o)
+
+ def render(self):
+ display(Javascript(self._repr_javascript_()))
+
+ def _repr_javascript_(self):
+ js = _renderer3d_template % (self.bgcolor, self.width, self.height,
+ self.var, self._xtk_name, self.var, self.var)
+ for o in self._objects:
+ js += o.generate_js_fragment()
+ js += ' %s.add(%s);\n' % (self.var, o.var)
+ js += ' %s.render();\n' % self.var
+ js = Javascript(js)
+ print js._repr_javascript_()
+ return js._repr_javascript_()
+
+
+code = """
+ container.show();
+ var id = 'xtkwidget_' + utils.uuid();
+ var xtkdiv = $('<div/>').attr('id',id);
+ xtkdiv.css('background-color','%s').width(%i).height(%i);
+ element.append(xtkdiv);
+ var r = new X.renderer3D();
+ r.container = id;
+ r.init();
+ var m = new X.mesh();
+
+ r.add(m);
+ r.render();
+"""
+
+
+class OldMesh(object):
+ """Display an XTK mesh object using a URL."""
+
+ def __init__(self, url, width=400, height=300, magicmode=False, opacity=1.0, bgcolor='#000'):
+ """Create an XTK mesh from a URL.
+
+ Parameters
+ ==========
+ url : str
+ The URL to the data files to render. This can be an absolute URL or one that is
+ relative to the notebook server ('files/mymesh.vtk').
+ width : int
+ The width in pixels of the XTK widget.
+ height : int
+ The height in pixels of the XTK widget.
+ magicmode : bool
+ Enable magicmode, which colors points based on their positions.
+ opacity : float
+ The mesh's opacity in the range 0.0 to 1.0.
+ bgcolor : str
+ The XTK widget's background color.
+ """
+ self.url = url
+ self.width = width
+ self.height = height
+ self.magicmode = 'true' if magicmode else 'false'
+ self.opacity = opacity
+ self.bgcolor = bgcolor
+
+ def _repr_javascript_(self):
+ js = code % (self.bgcolor, self.width, self.height, self.url, self.magicmode, self.opacity)
+ js = Javascript(js, lib='http://get.goXTK.com/xtk_edge.js')
+ return js._repr_javascript_()
+
View
88 IPython/lib/xtkdisplay.py
@@ -1,88 +0,0 @@
-"""Display classes for the XTK JavaScript library.
-
-The XTK JavaScript library uses WebGL to render 3D visualizations. It can
-generate those visualizations based a range of standard 3D data files types,
-including .vtk and .stl. This module makes it possible to render these
-visualizations in the IPython Notebook.
-
-A simple example would be::
-
- from IPython.lib.xtkdisplay import Mesh
- Mesh('http://x.babymri.org/?skull.vtk', opacity=0.5, magicmode=True)
-
-Authors:
-
-* Brian Granger
-"""
-
-#-----------------------------------------------------------------------------
-# Copyright (C) 2012 The IPython Development Team
-#
-# Distributed under the terms of the BSD License. The full license is in
-# the file COPYING, distributed as part of this software.
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# Imports
-#-----------------------------------------------------------------------------
-
-import os
-
-from IPython.core.display import Javascript
-
-#-----------------------------------------------------------------------------
-# Classes
-#-----------------------------------------------------------------------------
-
-
-code = """
- container.show();
- var id = 'xtkwidget_' + utils.uuid();
- var xtkdiv = $('<div/>').attr('id',id);
- xtkdiv.css('background-color','%s').width(%i).height(%i);
- element.append(xtkdiv);
- var r = new X.renderer3D();
- r.container = id;
- r.init();
- var m = new X.mesh();
- m.file = "%s";
- m.magicmode = %s;
- m.opacity = %f;
- r.add(m);
- r.render();
-"""
-
-class Mesh(object):
- """Display an XTK mesh object using a URL."""
-
- def __init__(self, url, width=400, height=300, magicmode=False, opacity=1.0, bgcolor='#000'):
- """Create an XTK mesh from a URL.
-
- Parameters
- ==========
- url : str
- The URL to the data files to render. This can be an absolute URL or one that is
- relative to the notebook server ('files/mymesh.vtk').
- width : int
- The width in pixels of the XTK widget.
- height : int
- The height in pixels of the XTK widget.
- magicmode : bool
- Enable magicmode, which colors points based on their positions.
- opacity : float
- The mesh's opacity in the range 0.0 to 1.0.
- bgcolor : str
- The XTK widget's background color.
- """
- self.url = url
- self.width = width
- self.height = height
- self.magicmode = 'true' if magicmode else 'false'
- self.opacity = opacity
- self.bgcolor = bgcolor
-
- def _repr_javascript_(self):
- js = code % (self.bgcolor, self.width, self.height, self.url, self.magicmode, self.opacity)
- js = Javascript(js, lib='http://get.goXTK.com/xtk_edge.js')
- return js._repr_javascript_()
-
View
217 docs/examples/notebooks/xtk_display.ipynb
@@ -26,11 +26,24 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "from IPython.lib.xtkdisplay import Mesh"
+ "from IPython.lib.xtk import Mesh, Sphere, Renderer3D, Cube, Cylinder, load_xtk\n",
+ "from IPython.display import display\n",
+ "load_xtk()"
],
"language": "python",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "javascript": [
+ "$.getScript(\"http://get.goXTK.com/xtk_edge.js\", function () {\n",
+ "alert(\"XTK library loaded\");});\n"
+ ],
+ "output_type": "display_data",
+ "text": [
+ "<IPython.core.display.Javascript at 0x107f57050>"
+ ]
+ }
+ ],
"prompt_number": 1
},
{
@@ -44,7 +57,10 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "Mesh('http://x.babymri.org/?skull.vtk', width=600, height=400)"
+ "m = Mesh('http://x.babymri.org/?skull.vtk')\n",
+ "r = Renderer3D(width=600, height=400)\n",
+ "r.add(m)\n",
+ "r.render()"
],
"language": "python",
"metadata": {},
@@ -58,25 +74,26 @@
" var xtkdiv = $('<div/>').attr('id',id);\n",
" xtkdiv.css('background-color','#000').width(600).height(400);\n",
" element.append(xtkdiv);\n",
- " var r = new X.renderer3D();\n",
- " r.container = id;\n",
- " r.init();\n",
- " var m = new X.mesh();\n",
- " m.file = \"http://x.babymri.org/?skull.vtk\";\n",
- " m.magicmode = false;\n",
- " m.opacity = 1.000000;\n",
- " r.add(m);\n",
- " r.render();\n",
+ " var obj_bd575c49678740f7a464c8bf28f9bdd4 = new X.renderer3D();\n",
+ " obj_bd575c49678740f7a464c8bf28f9bdd4.container = id;\n",
+ " obj_bd575c49678740f7a464c8bf28f9bdd4.init();\n",
+ "\n",
+ " var obj_f0b5414cb5ec45b5adf1832d3b9406ce = new X.mesh();\n",
+ " obj_f0b5414cb5ec45b5adf1832d3b9406ce.magicmode = false;\n",
+ " obj_f0b5414cb5ec45b5adf1832d3b9406ce.opacity = 1.000000;\n",
+ " obj_f0b5414cb5ec45b5adf1832d3b9406ce.color = [1.000000,1.000000,1.000000];\n",
+ " obj_f0b5414cb5ec45b5adf1832d3b9406ce.file = \"http://x.babymri.org/?skull.vtk\";\n",
+ " obj_bd575c49678740f7a464c8bf28f9bdd4.add(obj_f0b5414cb5ec45b5adf1832d3b9406ce);\n",
+ " obj_bd575c49678740f7a464c8bf28f9bdd4.render();\n",
"});\n"
],
- "output_type": "pyout",
- "prompt_number": 2,
+ "output_type": "display_data",
"text": [
- "<IPython.lib.xtkdisplay.Mesh at 0x107f47250>"
+ "<IPython.core.display.Javascript at 0x10800bb90>"
]
}
],
- "prompt_number": 2
+ "prompt_number": 5
},
{
"cell_type": "markdown",
@@ -89,35 +106,173 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "Mesh('files/smallsurface.vtk', opacity=0.7, magicmode=True, bgcolor='#FFF')"
+ "m = Mesh('files/smallsurface.vtk', opacity=0.7, magicmode=True)\n",
+ "r = Renderer3D(bgcolor='#FFF')\n",
+ "r.add(m)\n",
+ "r.render()"
],
"language": "python",
"metadata": {},
"outputs": [
{
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " container.show();\n",
+ " var id = 'xtkwidget_' + utils.uuid();\n",
+ " console.log(id);\n",
+ " var xtkdiv = $('<div/>').attr('id',id);\n",
+ " xtkdiv.css('background-color','#FFF').width(400).height(300);\n",
+ " element.append(xtkdiv);\n",
+ " var obj_268de400443e4ea19ef37c267f72646c = new X.renderer3D();\n",
+ " obj_268de400443e4ea19ef37c267f72646c.container = id;\n",
+ " //obj_268de400443e4ea19ef37c267f72646c.init();\n",
+ "\n",
+ " //var obj_5080ab732ebb4db6ba8b1017638a26e7 = new X.mesh();\n",
+ " //obj_5080ab732ebb4db6ba8b1017638a26e7.magicmode = true;\n",
+ " //obj_5080ab732ebb4db6ba8b1017638a26e7.opacity = 0.700000;\n",
+ " //obj_5080ab732ebb4db6ba8b1017638a26e7.color = [1.000000,1.000000,1.000000];\n",
+ " //obj_5080ab732ebb4db6ba8b1017638a26e7.file = \"files/smallsurface.vtk\";\n",
+ " //obj_268de400443e4ea19ef37c267f72646c.add(obj_5080ab732ebb4db6ba8b1017638a26e7);\n",
+ " //obj_268de400443e4ea19ef37c267f72646c.render();\n",
+ "\n"
+ ]
+ },
+ {
"javascript": [
- "$.getScript(\"http://get.goXTK.com/xtk_edge.js\", function () {\n",
"\n",
" container.show();\n",
" var id = 'xtkwidget_' + utils.uuid();\n",
+ " console.log(id);\n",
" var xtkdiv = $('<div/>').attr('id',id);\n",
" xtkdiv.css('background-color','#FFF').width(400).height(300);\n",
" element.append(xtkdiv);\n",
- " var r = new X.renderer3D();\n",
- " r.container = id;\n",
- " r.init();\n",
- " var m = new X.mesh();\n",
- " m.file = \"files/smallsurface.vtk\";\n",
- " m.magicmode = true;\n",
- " m.opacity = 0.700000;\n",
- " r.add(m);\n",
- " r.render();\n",
- "});\n"
+ " var obj_268de400443e4ea19ef37c267f72646c = new X.renderer3D();\n",
+ " obj_268de400443e4ea19ef37c267f72646c.container = id;\n",
+ " //obj_268de400443e4ea19ef37c267f72646c.init();\n",
+ "\n",
+ " //var obj_5080ab732ebb4db6ba8b1017638a26e7 = new X.mesh();\n",
+ " //obj_5080ab732ebb4db6ba8b1017638a26e7.magicmode = true;\n",
+ " //obj_5080ab732ebb4db6ba8b1017638a26e7.opacity = 0.700000;\n",
+ " //obj_5080ab732ebb4db6ba8b1017638a26e7.color = [1.000000,1.000000,1.000000];\n",
+ " //obj_5080ab732ebb4db6ba8b1017638a26e7.file = \"files/smallsurface.vtk\";\n",
+ " //obj_268de400443e4ea19ef37c267f72646c.add(obj_5080ab732ebb4db6ba8b1017638a26e7);\n",
+ " //obj_268de400443e4ea19ef37c267f72646c.render();\n"
+ ],
+ "output_type": "display_data",
+ "text": [
+ "<IPython.core.display.Javascript at 0x107f57890>"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "r = Renderer3D()\n",
+ "s = Sphere((0,0,0),1,color=(1.0,0.0,0.0))\n",
+ "r.add(s)\n",
+ "c = Cube((1,1,1),(1,1,1),color=(0.0,1.0,0.0))\n",
+ "r.add(c)\n",
+ "cy = Cylinder((2,0,0),(4,0,0),1,color=(0.0,0.0,1.0))\n",
+ "r.add(cy)\n",
+ "r.render()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " container.show();\n",
+ " var id = 'xtkwidget_' + utils.uuid();\n",
+ " console.log(id);\n",
+ " var xtkdiv = $('<div/>').attr('id',id);\n",
+ " xtkdiv.css('background-color','#000').width(400).height(300);\n",
+ " element.append(xtkdiv);\n",
+ " var obj_6b118f2c172644d59d18f083a5b4f473 = new X.renderer3D();\n",
+ " obj_6b118f2c172644d59d18f083a5b4f473.container = id;\n",
+ " //obj_6b118f2c172644d59d18f083a5b4f473.init();\n",
+ "\n",
+ " //var obj_5bdf9b9644674e54bfc79aeb6db8082f = new X.sphere();\n",
+ " //obj_5bdf9b9644674e54bfc79aeb6db8082f.magicmode = false;\n",
+ " //obj_5bdf9b9644674e54bfc79aeb6db8082f.opacity = 1.000000;\n",
+ " //obj_5bdf9b9644674e54bfc79aeb6db8082f.color = [1.000000,0.000000,0.000000];\n",
+ " obj_5bdf9b9644674e54bfc79aeb6db8082f.center = [0.000000,0.000000,0.000000];\n",
+ " obj_5bdf9b9644674e54bfc79aeb6db8082f.radius = 1.000000;\n",
+ " //obj_6b118f2c172644d59d18f083a5b4f473.add(obj_5bdf9b9644674e54bfc79aeb6db8082f);\n",
+ "\n",
+ " //var obj_0300e58b0a5a455fb012689c6fc856e9 = new X.cube();\n",
+ " //obj_0300e58b0a5a455fb012689c6fc856e9.magicmode = false;\n",
+ " //obj_0300e58b0a5a455fb012689c6fc856e9.opacity = 1.000000;\n",
+ " //obj_0300e58b0a5a455fb012689c6fc856e9.color = [0.000000,1.000000,0.000000];\n",
+ " obj_0300e58b0a5a455fb012689c6fc856e9.center = [1.000000,1.000000,1.000000];\n",
+ " obj_0300e58b0a5a455fb012689c6fc856e9.lengthX = 1.000000;\n",
+ " obj_0300e58b0a5a455fb012689c6fc856e9.lengthY = 1.000000;\n",
+ " obj_0300e58b0a5a455fb012689c6fc856e9.lengthZ = 1.000000;\n",
+ " //obj_6b118f2c172644d59d18f083a5b4f473.add(obj_0300e58b0a5a455fb012689c6fc856e9);\n",
+ "\n",
+ " //var obj_50327728520a4dc0a665dff4d645b0b4 = new X.cylinder();\n",
+ " //obj_50327728520a4dc0a665dff4d645b0b4.magicmode = false;\n",
+ " //obj_50327728520a4dc0a665dff4d645b0b4.opacity = 1.000000;\n",
+ " //obj_50327728520a4dc0a665dff4d645b0b4.color = [0.000000,0.000000,1.000000];\n",
+ " obj_50327728520a4dc0a665dff4d645b0b4.start = [2.000000,0.000000,0.000000];\n",
+ " obj_50327728520a4dc0a665dff4d645b0b4.end = [4.000000,0.000000,0.000000];\n",
+ " obj_50327728520a4dc0a665dff4d645b0b4.radius = 1.000000;\n",
+ " //obj_6b118f2c172644d59d18f083a5b4f473.add(obj_50327728520a4dc0a665dff4d645b0b4);\n",
+ " //obj_6b118f2c172644d59d18f083a5b4f473.render();\n",
+ "\n"
+ ]
+ },
+ {
+ "javascript": [
+ "\n",
+ " container.show();\n",
+ " var id = 'xtkwidget_' + utils.uuid();\n",
+ " console.log(id);\n",
+ " var xtkdiv = $('<div/>').attr('id',id);\n",
+ " xtkdiv.css('background-color','#000').width(400).height(300);\n",
+ " element.append(xtkdiv);\n",
+ " var obj_6b118f2c172644d59d18f083a5b4f473 = new X.renderer3D();\n",
+ " obj_6b118f2c172644d59d18f083a5b4f473.container = id;\n",
+ " //obj_6b118f2c172644d59d18f083a5b4f473.init();\n",
+ "\n",
+ " //var obj_5bdf9b9644674e54bfc79aeb6db8082f = new X.sphere();\n",
+ " //obj_5bdf9b9644674e54bfc79aeb6db8082f.magicmode = false;\n",
+ " //obj_5bdf9b9644674e54bfc79aeb6db8082f.opacity = 1.000000;\n",
+ " //obj_5bdf9b9644674e54bfc79aeb6db8082f.color = [1.000000,0.000000,0.000000];\n",
+ " obj_5bdf9b9644674e54bfc79aeb6db8082f.center = [0.000000,0.000000,0.000000];\n",
+ " obj_5bdf9b9644674e54bfc79aeb6db8082f.radius = 1.000000;\n",
+ " //obj_6b118f2c172644d59d18f083a5b4f473.add(obj_5bdf9b9644674e54bfc79aeb6db8082f);\n",
+ "\n",
+ " //var obj_0300e58b0a5a455fb012689c6fc856e9 = new X.cube();\n",
+ " //obj_0300e58b0a5a455fb012689c6fc856e9.magicmode = false;\n",
+ " //obj_0300e58b0a5a455fb012689c6fc856e9.opacity = 1.000000;\n",
+ " //obj_0300e58b0a5a455fb012689c6fc856e9.color = [0.000000,1.000000,0.000000];\n",
+ " obj_0300e58b0a5a455fb012689c6fc856e9.center = [1.000000,1.000000,1.000000];\n",
+ " obj_0300e58b0a5a455fb012689c6fc856e9.lengthX = 1.000000;\n",
+ " obj_0300e58b0a5a455fb012689c6fc856e9.lengthY = 1.000000;\n",
+ " obj_0300e58b0a5a455fb012689c6fc856e9.lengthZ = 1.000000;\n",
+ " //obj_6b118f2c172644d59d18f083a5b4f473.add(obj_0300e58b0a5a455fb012689c6fc856e9);\n",
+ "\n",
+ " //var obj_50327728520a4dc0a665dff4d645b0b4 = new X.cylinder();\n",
+ " //obj_50327728520a4dc0a665dff4d645b0b4.magicmode = false;\n",
+ " //obj_50327728520a4dc0a665dff4d645b0b4.opacity = 1.000000;\n",
+ " //obj_50327728520a4dc0a665dff4d645b0b4.color = [0.000000,0.000000,1.000000];\n",
+ " obj_50327728520a4dc0a665dff4d645b0b4.start = [2.000000,0.000000,0.000000];\n",
+ " obj_50327728520a4dc0a665dff4d645b0b4.end = [4.000000,0.000000,0.000000];\n",
+ " obj_50327728520a4dc0a665dff4d645b0b4.radius = 1.000000;\n",
+ " //obj_6b118f2c172644d59d18f083a5b4f473.add(obj_50327728520a4dc0a665dff4d645b0b4);\n",
+ " //obj_6b118f2c172644d59d18f083a5b4f473.render();\n"
],
- "output_type": "pyout",
- "prompt_number": 2,
+ "output_type": "display_data",
"text": [
- "<IPython.lib.xtkdisplay.Mesh at 0x107f471d0>"
+ "<IPython.core.display.Javascript at 0x107f5d350>"
]
}
],

0 comments on commit fe525c4

Please sign in to comment.
Something went wrong with that request. Please try again.