Section 7.5.2
Finite Solid Primitives

There are twelve different solid finite primitive shapes: blob, box, cone, cylinder, fractal, height field, lathe, sphere, superellipsoid, surface of revolution, text object and torus. These have a well-defined inside and can be used in CSG (see section "Constructive Solid Geometry"). They are finite and respond to automatic bounding. As with all shapes they can be translated, rotated and scaled.

Section 7.5.2.1
Blob

Blobs are an interesting and flexible object type. Mathematically they are iso-surfaces of scalar fields, i. e. their surface is defined by the strength of the field in each point. If this strength is equal to a threshold value you're on the surface otherwise you're not.

Picture each blob component as an object floating in space. This object is filled with a field that has its maximum at the center of the object and drops off to zero at the object's surface. The field strength of all those components are added together to form the field of the blob. Now POV-Ray looks for points where this field has a given value, the threshold value. All these points form the surface of the blob object. Points with a greater field value than the threshold value are considered to be inside while points with a smaller field value are outside.

There's another, simpler way of looking at blobs. They can be seen as a union of flexible components that attract or repel each other to form a blobby organic looking shape. The components' surfaces actually stretch out smoothly and connect as if they were made of honey or something like that.

A blob is made up of spherical and cylindrical components and is defined as follows:

blob { threshold THRESHOLD_VALUE cylinder { <END1>, <END2>, RADIUS, [ strength ] STRENGTH } sphere { <CENTER>, RADIUS, [ strength ] STRENGTH } [ component STRENGTH, RADIUS, <CENTER> ] [ hierarchy FLAG ] [ sturm ] }

The threshold keyword determines the total field strength value that POV-Ray is looking for. By following the ray out into space and looking at how each blob component affects the ray, POV-Ray will find the points in space where the field strength is equal to the threshold value. The following list shows some things you should know about the threshold value.

1)The threshold value must be positive.
2)A component disappears if the threshold value is greater than its strength.
3)As the threshold value gets larger the surface you see gets closer to the centers of the components.
4)As the threshold value gets smaller, the surface you see gets closer to the surface of the components.

Cylindrical components are specified by the keyword cylinder giving a cylinder formed by the base <END1>, the apex <END2> and the radius. The cylinder has hemispherical caps at the base and apex. Spherical components are specified by the keyword sphere forming a sphere at <CENTER> with the given radius. Each component can be individually translated, rotated, scaled and textured. The complete syntax for the cylindrical and spherical components is:

sphere { <CENTER>, RADIUS, [strength] STRENGTH [ translate <VECTOR> ] [ rotate <VECTOR> ] [ scale <VECTOR> ] TEXTURE_MODIFIERS } cylinder { <END1>, <END2>, RADIUS, [strength] STRENGTH [ translate <VECTOR> ] [ rotate <VECTOR> ] [ scale <VECTOR> ] TEXTURE_MODIFIERS }

By unevenly scaling a spherical component you can create ellipsoidal components. The component keyword gives a spherical component and is only used for compatibility with earlier POV-Ray versions.

The strength parameter is a float value specifying the field strength at the center of the object. The strength may be positive or negative. A positive value will make that component attract other components while a negative value will make it repel other components. Components in different, separate blob shapes do not affect each other.

You should keep the following things in mind.

1)The strength value may be positive or negative. Zero is a bad value, as the net result is that no field was added --- you might just as well have not used this component.
2)If strength is positive, then POV-Ray will add the component's field to the space around the center of the component. If this adds enough field strength to be greater than the "threshold" value you will see a surface.
3)If the strength value is negative, then POV-Ray will subtract the component's field from the space around the center of the component. This will only do something if there happen to be positive components nearby. What happens is that the surface around any nearby positive components will be dented away from the center of the negative component.

The components of each blob object are internally bounded by a spherical bounding hierarchy to speed up blob intersection tests and other operations. By using the optional keyword hierarchy you can switch this hierarchy off.

An example of a three component blob is:

blob { threshold 0.6 sphere { <.75, 0, 0>, 1, 1 } sphere { <-.375, .64952, 0>, 1, 1 } sphere { <-.375, -.64952, 0>, 1, 1 } scale 2 }

If you have a single blob component then the surface you see will just look like the object used, i. e. a sphere or a cylinder, with the surface being somewhere inside the surface specified for the component. The exact surface location can be determined from the blob equation listed below (you will probably never need to know this, blobs are more for visual appeal than for exact modeling).

For the more mathematically minded, here's the formula used internally by POV-Ray to create blobs. You don't need to understand this to use blobs. The formula used for a single blob component is:

density = strength * (1 - radius^2)^2

This formula has the nice property that it is exactly equal to the strength parameter at the center of the component and drops off to exactly 0 at a distance from the center of the component that is equal to the radius value. The density formula for more than one blob component is just the sum of the individual component densities:

density = density1 + density2 + ...

The calculations for blobs must be very accurate. If this shape renders improperly you may add the keyword sturm after the last component to use POV-Ray's slower-yet-more-accurate Sturmian root solver.


Section 7.5.2.2
Box

A simple box can be defined by listing two corners of the box like this:

box { <CORNER1>, <CORNER2> }


The geometry of a box.

Where <CORNER1> and <CORNER2> are vectors defining the x, y, z coordinates of the opposite corners of the box.

Note that all boxes are defined with their faces parallel to the coordinate axes. They may later be rotated to any orientation using the rotate keyword.

Each element of <CORNER1> should always be less than the corresponding element in <CORNER2>. If any elements of <CORNER1> are larger than <CORNER2> the box will not appear in the scene.

Boxes are calculated efficiently and make good bounding shapes (if manually bounding seems to be necessary).


Section 7.5.2.3
Cone

A finite length cone or a frustum (a cone with the point cut off) may be defined by.

cone { <BASE_POINT>, BASE_RADIUS, <CAP_POINT>, CAP_RADIUS [ open ] }


The geometry of a cone.

Where <BASE_POINT> and < CAP_POINT> are vectors defining the x, y, z coordinates of the center of the cone's base and cap and BASE_RADIUS and CAP_RADIUS are float values for the corresponding radii.

Normally the ends of a cone are closed by flat planes which are parallel to each other and perpendicular to the length of the cone. Adding the optional keyword open after CAP_RADIUS will remove the end caps and results in a tapered hollow tube like a megaphone or funnel.


Section 7.5.2.4
Cylinder

A finite length cylinder with parallel end caps may be defined by.

cylinder { <BASE_POINT>, <CAP_POINT>, RADIUS [ open ] }


The geometry of a cylinder.

Where <BASE_POINT> and < CAP_POINT> are vectors defining the x, y, z coordinates of the cylinder's base and cap and RADIUS is a float value for the radius.

Normally the ends of a cylinder are closed by flat planes which are parallel to each other and perpendicular to the length of the cylinder. Adding the optional keyword open after the radius will remove the end caps and results in a hollow tube.


Next Section
Table Of Contents