BruceSherwood / vpython-jupyter

This repository has been moved to https://github.com/vpython/vpython-jupyter
64 stars 33 forks source link

Trails don't work correctly with multiple movements in one cell #4

Closed akaihola closed 8 years ago

akaihola commented 8 years ago

When moving a make_Trails=True object multiple times in one notebook cell, the trail is only drawn from the initial position to the final position. For example:

b = box(make_trail=True)
b.pos = vec(5, 0, 0)
b.pos = vec(5, 5, 0)

This doesn't draw two perpendicular trail segments, but a single diagonal one.

If I add a scene.waitfor('redraw') or scene.waitfor('draw_complete') between the moves, I get correct trails most of the time, but not always.

See my trails notebook hosted on mybinder.org for a more complete test case.

I'm using vpython 0.3.2.

BruceSherwood commented 8 years ago

See http://www.glowscript.org/docs/VPythonDocs/trail.html, which now provides more details. You need to say b = box(make_trail=True, interval=1), in which case you will get (correctly) a single vertical line, or say b = box(pos=vec(0,0,0), make_trail=True, inteval=1), in which case you will get a horizontal line and a vertical line. In addition to inadequate documentation, there was also a bug in Jupyter VPython 0.3.2, which is fixed in 0.3.3. Thanks for the report.