GlowScript 2.2: Improved extrusion and compound objects

20 views
Skip to first unread message

Bruce Sherwood

unread,
Nov 12, 2016, 2:11:48 PM11/12/16
to Glowscript Users
Working with the extrusion and compound objects in GlowScript 2.1 uncovered some significant design issues which GlowScript 2.2 addresses. Of course GlowScript 2.1 programs continue to work as before. Here are the changes in GlowScript 2.2:
 
1) Both the extrusion and compound objects are now very similar to the box object. In GlowScript 2.1, the bounding box (size) was vec(1,1,1), the actual bounding box was not known, and size could only be changed multiplicatively. In GlowScript 2.2 the bounding box (size) is the actual size of the object, which can be changed by setting size to the desired value.
  
2) In an extrusion object, the path along which a 2D shape is extruded is now called "path" instead of "pos". This means that when you create an extrusion object you can include a "pos" value along with the path specification.
 
3) In GlowScript 2.2, when you create an extrusion or compound object, the value of "pos" is set to the computed center of the object. If you specify "pos" when creating the object, the object is moved so that its center is located at the new location.

4) As with other objects such as box or cylinder, changing the axis of an extrusion or compound object not only rotates the object but its length (size.x) is set equal to the magnitude of the axis vector. Similarly, changing the size sets the magnitude of the axis vector to be equal to the length (size.x).

If you make no changes to an extrusion or compound object after creating it, the only difference from GlowScript 2.1 is the need to say "path" instead of "pos" when describing the path of an extrusion, and changing "origin" to "pos" if origin was used in creating the extrusion.

The Example programs at glowscript.org have been updated to version 2.2. The only programs that required modifications were Extrusions, Gyroscope, MousePicking, and Stonehenge.
 
 Here are the pages in the GlowScript Help that give the details, with links to the documentation for the GlowScript 2.1 objects:
 
 
 
These changes will facilitate implementing extrusion and 3D text objects in Jupyter VPython, which are currently not available.

Reply all
Reply to author
Forward
0 new messages