2.3. Geometric objects

GroIMP provides a set of geometric objects like spheres, cones and boxes by means of specific node classes. The distinction between these classes and turtle commands is somewhat artificial and mainly due to historical reasons. The geometic objects can be found in the Java package de.grogra.imp3d.objects, a full list is contained in the online documentation located at https://javadoc.grogra.de/imp3d/de/grogra/imp3d/objects/package-summary.html. The following table gives an overview of some of the available geometric objects.

Table 2.3. Geometric objects

ObjectMeaning
Sphere(r)Sphere of radius r
Box(z)Box of length z and base 1 × 1
Box(z, w, h)Box of length z (z-extension), width w (x-extension) and height h (y-extension)
Cylinder(z, r)Cylinder of length z (in z-direction) and radius r
Cone(z, r)Cone of length z (in z-direction) and base radius r
Frustum(z, r, t)Frustum of length z (in z-direction), base radius r and top radius t

As for the turtle commands, the listed geometric objects can be used in the specified form as patterns on the left hand side of a rule. E.g., it is possible to write

Sphere(r) ==> Sphere(r*2);

In addition to these basic geometric objects, GroIMP provides features for advanced geometry such as the construction of smooth spline surfaces. These features will be described later.