Skip to content

Commit

Permalink
Fix for mesh wire not rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Drawert committed Jun 14, 2016
1 parent a4386cd commit a6154f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyurdme/pyurdme.py
Expand Up @@ -1336,7 +1336,7 @@ def export_to_three_js(self, colors = None):
def _ipython_display_(self, filename=None, colors=None, width=500):
self.display(filename=filename, colors=colors, width=width)

def display(self, filename=None, colors=None, width=500):
def display(self, filename=None, colors=None, width=500, camera=[0,0,1]):
jstr = self.export_to_three_js(colors=colors)
hstr = None
with open(os.path.dirname(os.path.abspath(__file__))+"/data/three.js_templates/mesh.html",'r') as fd:
Expand All @@ -1350,6 +1350,10 @@ def display(self, filename=None, colors=None, width=500):
# div in Ipython notebook
displayareaid=str(uuid.uuid4())
hstr = hstr.replace('###DISPLAYAREAID###',displayareaid)
# ###CAMERA_X###, ###CAMERA_Y###, ###CAMERA_Z###
hstr = hstr.replace('###CAMERA_X###',str(camera[0]))
hstr = hstr.replace('###CAMERA_Y###',str(camera[1]))
hstr = hstr.replace('###CAMERA_Z###',str(camera[2]))
html = '<div style="width: {0}px; height: {1}px;" id="{2}" ></div>'.format(width, height, displayareaid)

if filename is not None:
Expand Down

0 comments on commit a6154f6

Please sign in to comment.