From: Bruce S. <bas...@nc...> - 2010-09-15 18:50:34
|
Suppose we don't add any new file to site-packages/visual but simply document something like the following, for the ultimate flexibility that some people want and need. Here is a little program that explicitly imports individual components and then uses them: # Very explicit imports: from visual.cvisual import (vector, mag, mag2, norm, cross, rotate, comp, proj, diff_angle, rate, waitclose) from visual.primitives import (arrow, cylinder, cone, sphere, box, ring, label, frame, pyramid, ellipsoid, curve, faces, convex, helix, points, text, distant_light, local_light) from visual.ui import display import visual.crayola as color import visual.materials as materials import visual.site_settings import atexit as _atexit _atexit.register(waitclose) scene = display() # Now use this stuff: box(pos=(1.5,0,0), color=color.orange, material=materials.wood) C = curve(pos=[(0,0,0),(1,0,0),(1,1,0),(0,1,0)], color=color.cyan) print(C.pos) scene.mouse.getclick() scene2 = display(x=400) sphere() I don't know whether the imports listed above really do span the space, which requires more testing. Bruce Sherwood |