From: Bruce S. <Bru...@nc...> - 2010-03-31 01:23:28
|
VPython 5.3 is now available for all platforms. It offers the following enhancements. *New 3D text object* Thanks to great work by Kadir Haldenbilen, there is a new "text" object that from any True Type (.ttf) font produces extruded 3D text. This supercedes the very limited old visual.text machinery (which however is being left in place for upward compatibility). Kadir had to identify and exploit various font-related modules to find a font, identify its contours, and split the solid portions of characters into triangles to be used in a faces object. These additional font-related modules are bundled into the Windows and Mac versions. As usual, until and unless someone makes a distribution package, Linux users will have to install them manually: they are FontTools, ttfquery, and Polygon. See the detailed documentation on the new text object in the help that is installed with VPython. You may find some minor glitches. For example, the "&" is filled in on the sans-serif font Verdana, other fonts show o's and other such letters filled in, and some fonts give execution errors due to being ill-formed. You are invited to report problems with fonts or specific characters of fonts. Polygon is being distributed in the Windows and Mac installers subject to the following conditions: "This distribution contains code from the GPC Library, and/or code resulting from the use of the GPC Library. This usage has been authorized by The University of Manchester, on the understanding that the GPC-related features are used only in the context of this distribution. It is not permitted to extract the GPC code from the distribution as the basis for commercial exploitation, unless a GPC Commercial Use Licence is obtained from The University of Manchester, contact: http://www.cs.man.ac.uk/~toby/gpc/". *Enhancements to faces object* You can now create a faces object f, specifying only the positions of the vertices, then use f.make_normals() to create normals that are perpendicular to all the faces. You can also use f.make_twosided() to convert a one-sided faces object into a two-sided one. You can now say f.append(pos=(x,y,z)), whereas formerly you also had to give a normal when appending a vertex. You can use the previously announced f.smooth() to average similar normals in adjacent triangles to make the object look smoother, and with VPython 5.3 you can specify the smoothing criterion: f.smooth(0.7) means that normals whose directions differ by an angle whose cosine is greater than 0.7 (about 45 degrees) will be averaged. The simple form f.smooth() corresponds to f.smooth(0.95), in which case normals within 18 degrees of each other will be averaged. *Highlighting a curve when making a graph* When using gcurve to graph a function, there is a problem that you may not notice any plotting if the function repeats back on itself. You can now highlight the current plotting position in the gcurve by specifying a "dot" option: gcurve(dot=True). By default the dot has the same color as the gcurve, is round, and has a width of 8 pixels. You can change these defaults: gcurve(dot=True, dot_color=color.blue, shape='square', size=15). *Minor bug fixes* Some bugs were fixed. The helix object didn't have a "visible" attribute. If you had more than one points object, some with round points and some with square points, you saw only round points. Some technical bugs in the faces object were corrected. |