VPython

Last updated
Visual (Python Library)
Original author(s) David Scherer
Initial release2000;24 years ago (2000)
Stable release
7.5.2 / November 11, 2019;4 years ago (2019-11-11) [1]
Written in C++, Python
Operating system Cross-platform
License Open source
Website www.vpython.org

VPython is Open Source, and a part of the Python Library, combining the Python programming language with a simple 3D graphics module called Visual.

Contents

This library application allows users to create 3D objects, such as spheres and cones, and then display these objects in an app window. This aids creation of simple visualizations, allowing programmers to focus more on the computational aspect of their programs. VPython is a common tool for the illustration of simple mathematics and physics, especially in educational environments, due to its simplicity and open source licensing.

History

The cT programming language was developed in 1985 by researchers at Carnegie Mellon University, with contributions from individuals such as David Andersen, Bruce Sherwood  [ eo ], Judith Sherwood, and Kevin Whitley. Derived from predecessors like the TUTOR (1965) and the MicroTutor (1977) programming languages, cT found its primary application in generating 2D graphics within educational settings, particularly classrooms. Notably, numerous educational programs, including those recognized by awards like VISQ, were authored in cT, particularly in the realm of physics. In 1997, students at Carnegie Mellon University were introduced to cT through a newly devised introductory physics course led by Ruth Chabay and Bruce Sherwood.

In 1998, David Scherer entered the university as a freshman and enrolled in one of the introductory physics classes that used cT. Although cT offered a relatively easy 2D graphics programming environment, Scherer saw the possibility of creating an even better tool. In the spring and summer of 2000, with the assistance of David Andersen, Ruth Chabay, Ari Heitner, Ian Peters, and Bruce Sherwood, Scherer created Visual, a module for Python that was not only easier to use than the cT programming language, but also rendered objects in three dimensions. The combination of Python plus Visual is called VPython. Further development of the cT programming language was ended and the newly created VPython was used in its place. Since VPython's creation, several versions have been released to the public.

In 2016, developers announced [2] [3] that classic VPython would no longer be developed. Instead, development will concentrate on Glowscript and Jupyter implementations of the language.

Usage

VPython is a simple rendering tool for 3D objects and graphs. Its main use has been in education, but it has also been used in commercial or research settings. VPython was first used in introductory physics courses at Carnegie Mellon and then spread to other universities and eventually high schools, especially in connection with the Matter & Interactions curriculum.

A related development due to David Scherer and Bruce Sherwood is GlowScript, which makes it possible to write and run VPython programs in a browser, including on mobile devices.

Objects

See the article on Python for Python syntax. This article will address several of the objects that are VPython specific. Click here for the complete documentation. The cylinder object is a good example of a simple VPython object. Here is an example of a simple cylinder as given in VPython's documentation (in older VPython implementations, the module to import is vpython, not visual):

fromvisualimport*# Import the visual modulerod=cylinder(pos=(0,2,1),axis=(5,0,0),radius=1)

VisualRef-1.gif

Some similar objects offered by the VPython 3D rendering engine are the cone, sphere, and box objects. In addition to solid objects, VPython offers graphing tools as well. Here is an example of a simple graph in VPython as given in its documentation:

fromvisual.graphimport*# Import graphing featuresfromnumpyimportarange,cos,expfunct1=gcurve(color=color.cyan)# A connected curve objectforxinarange(0.,8.1,0.1):# x goes from 0 to 8funct1.plot(pos=(x,5.*cos(2.*x)*exp(-0.2*x)))# Plot

Related Research Articles

In computing, serialization is the process of translating a data structure or object state into a format that can be stored or transmitted and reconstructed later. When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of the original object. For many complex objects, such as those that make extensive use of references, this process is not straightforward. Serialization of object-oriented objects does not include any of their associated methods with which they were previously linked.

<span class="mw-page-title-main">LightWave 3D</span> 3D computer graphics program

LightWave 3D is a 3D computer graphics program developed by LightWave Digital. It has been used in films, television, motion graphics, digital matte painting, visual effects, video game development, product design, architectural visualizations, virtual production, music videos, pre-visualizations and advertising.

<span class="mw-page-title-main">Visual programming language</span> Programming language written graphically by a user

In computing, a visual programming language, also known as diagrammatic programming, graphical programming or block coding, is a programming language that lets users create programs by manipulating program elements graphically rather than by specifying them textually. A VPL allows programming with visual expressions, spatial arrangements of text and graphic symbols, used either as elements of syntax or secondary notation. For example, many VPLs are based on the idea of "boxes and arrows", where boxes or other screen objects are treated as entities, connected by arrows, lines or arcs which represent relations. VPLs are generally the basis of Low-code development platforms.

COLLADA is an interchange file format for interactive 3D applications. It is managed by the nonprofit technology consortium, the Khronos Group, and has been adopted by ISO as a publicly available specification, ISO/PAS 17506.

<span class="mw-page-title-main">Matplotlib</span> Library for creating static, animated, and interactive visualizations in Python.

Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy. It provides an object-oriented API for embedding plots into applications using general-purpose GUI toolkits like Tkinter, wxPython, Qt, or GTK. There is also a procedural "pylab" interface based on a state machine, designed to closely resemble that of MATLAB, though its use is discouraged. SciPy makes use of Matplotlib.

<span class="mw-page-title-main">Rhinoceros 3D</span> 3D computer graphics software

Rhinoceros is a commercial 3D computer graphics and computer-aided design (CAD) application software that was developed by TLM, Inc, dba Robert McNeel & Associates, an American, privately held, and employee-owned company that was founded in 1978. Rhinoceros geometry is based on the NURBS mathematical model, which focuses on producing mathematically precise representation of curves and freeform surfaces in computer graphics.

<span class="mw-page-title-main">Asymptote (vector graphics language)</span> Descriptive vector graphics language

Asymptote is a descriptive vector graphics language – developed by Andy Hammerlindl, John C. Bowman, and Tom Prince – which provides a natural coordinate-based framework for technical drawing. Asymptote runs on all major platforms. It is free software, available under the terms of the GNU Lesser General Public License (LGPL).

<span class="mw-page-title-main">Call graph</span> Structure in computing

A call graph is a control-flow graph, which represents calling relationships between subroutines in a computer program. Each node represents a procedure and each edge (f, g) indicates that procedure f calls procedure g. Thus, a cycle in the graph indicates recursive procedure calls.

<span class="mw-page-title-main">Python syntax and semantics</span> Set of rules defining correctly structured programs

The syntax of the Python programming language is the set of rules that defines how a Python program will be written and interpreted. The Python language has many similarities to Perl, C, and Java. However, there are some definite differences between the languages. It supports multiple programming paradigms, including structured, object-oriented programming, and functional programming, and boasts a dynamic type system and automatic memory management.

Panda3D is a game engine that includes graphics, audio, I/O, collision detection, and other abilities relevant to the creation of 3D games. Panda3D is free, open-source software under the revised BSD license.

<span class="mw-page-title-main">FreeCAD</span> Free and open-source 3D CAD software

FreeCAD is a general-purpose parametric 3D computer-aided design (CAD) modeler and a building information modeling (BIM) software application with finite element method (FEM) support. It is intended for mechanical engineering product design but also expands to a wider range of uses around engineering, such as architecture or electrical engineering. FreeCAD is free and open-source, under the LGPL-2.0-or-later license, and available for Linux, macOS, and Windows operating systems. Users can extend the functionality of the software using the Python programming language.

<span class="mw-page-title-main">OpenSCAD</span> Free software for creating 3D objects

OpenSCAD is a free software application for creating solid 3D computer-aided design (CAD) objects. It is a script-only based modeller that uses its own description language; the 3D preview can be manipulated interactively, but cannot be interactively modified in 3D. Instead, an OpenSCAD script specifies geometric primitives and defines how they are modified and combined to render a 3D model. As such, the program performs constructive solid geometry (CSG). OpenSCAD is available for Windows, Linux, and macOS.

<span class="mw-page-title-main">MeVisLab</span>

MeVisLab is a cross-platform application framework for medical image processing and scientific visualization. It includes advanced algorithms for image registration, segmentation, and quantitative morphological and functional image analysis. An IDE for graphical programming and rapid user interface prototyping is available.

<span class="mw-page-title-main">Nim (programming language)</span> Programming language

Nim is a general-purpose, multi-paradigm, statically typed, compiled high-level systems programming language, designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C, C++, Objective-C, and JavaScript, and supporting compiling to those same languages as intermediate representations.

PyTorch is a machine learning library based on the Torch library, used for applications such as computer vision and natural language processing, originally developed by Meta AI and now part of the Linux Foundation umbrella. It is recognized as one of the two most popular machine learning libraries alongside TensorFlow, offering free and open-source software released under the modified BSD license. Although the Python interface is more polished and the primary focus of development, PyTorch also has a C++ interface.

References

  1. Sherwood, Bruce. "GlowScript VPython and VPython 7" . Retrieved 11 November 2019.
  2. "VPython". vpython.org. Retrieved 2016-07-20.
  3. Sherwood, Bruce (25 January 2016). "The Evolution of VPython". Bruce Sherwood. Retrieved 20 July 2016.