`(require 'solid)`

http://people.csail.mit.edu/jaffer/Solid/#Example gives an
example use of this package.

— Function: **vrml**` node ...`

Returns the VRML97 string (including header) of the concatenation of strings

nodes, ....

— Function: **vrml-append**` node1 node2 ...`

Returns the concatenation with interdigitated newlines of strings

node1,node2, ....

— Function: **vrml-to-file**` file node ...`

Writes to file named

filethe VRML97 string (including header) of the concatenation of stringsnodes, ....

— Function: **world:info**` title info ...`

Returns a VRML97 string setting the title of the file in which it appears to

title. Additional stringsinfo, ... are comments.

VRML97 strings passed to `vrml`

and `vrml-to-file`

as
arguments will appear in the resulting VRML code. This string turns
off the headlight at the viewpoint:

" NavigationInfo {headlight FALSE}"

— Function: **scene:panorama**` front right back left top bottom`

Specifies the distant images on the inside faces of the cube enclosing the virtual world.

— Function: **scene:sphere**` colors angles`

colorsis a list of color objects. Each may be of type color, a 24-bit sRGB integer, or a list of 3 numbers between 0.0 and 1.0.

anglesis a list of non-increasing angles the same length ascolors. Each angle is between 90 and -90 degrees. If 90 or -90 are not elements ofangles, then the color at the zenith and nadir are taken from the colors paired with the angles nearest them.

`scene:sphere`

fills horizontal bands with interpolated colors on the background sphere encasing the world.

— Function: **scene:sun**` latitude julian-day hour turbidity strength`

— Function:**scene:sun**` latitude julian-day hour turbidity`

— Function:

latitudeis the virtual place's latitude in degrees.julian-dayis an integer from 0 to 366, the day of the year.houris a real number from 0 to 24 for the time of day; 12 is noon.turbidityis the degree of fogginess described in See turbidity.

`scene:sun`

returns a bright yellow, distant sphere where the sun would be athouronjulian-dayatlatitude. Ifstrengthis positive, included is a light source ofstrength(default 1).

— Function: **scene:overcast**` latitude julian-day hour turbidity strength`

— Function:**scene:overcast**` latitude julian-day hour turbidity`

— Function:

latitudeis the virtual place's latitude in degrees.julian-dayis an integer from 0 to 366, the day of the year.houris a real number from 0 to 24 for the time of day; 12 is noon.turbidityis the degree of cloudiness described in See turbidity.

`scene:overcast`

returns an overcast sky as it might look athouronjulian-dayatlatitude. Ifstrengthis positive, included is an ambient light source ofstrength(default 1).

Viewpoints are objects in the virtual world, and can be transformed individually or with solid objects.

— Function: **scene:viewpoint**` name distance compass pitch`

— Function:**scene:viewpoint**` name distance compass`

— Function:

Returns a viewpoint named

namefacing the origin and placeddistancefrom it.compassis a number from 0 to 360 giving the compass heading.pitchis a number from -90 to 90, defaulting to 0, specifying the angle from the horizontal.

— Function: **scene:viewpoints**` proximity`

Returns 6 viewpoints, one at the center of each face of a cube with sides 2 *

proximity, centered on the origin.

In VRML97, lights shine only on objects within the same children node
and descendants of that node. Although it would have been convenient
to let light direction be rotated by `solid:rotation`

, this
restricts a rotated light's visibility to objects rotated with it.

To workaround this limitation, these directional light source
procedures accept either Cartesian or spherical coordinates for
direction. A spherical coordinate is a list `(`

`theta`
`azimuth``)`

; where `theta` is the angle in degrees from the
zenith, and `azimuth` is the angle in degrees due west of south.

It is sometimes useful for light sources to be brighter than ‘`1`’.
When `intensity` arguments are greater than 1, these functions
gang multiple sources to reach the desired strength.

— Function: **light:ambient**` color intensity`

— Function:**light:ambient**` color`

— Function:

Ambient light shines on all surfaces with which it is grouped.

coloris a an object of type color, a 24-bit sRGB integer, or a list of 3 numbers between 0.0 and 1.0. Ifcoloris #f, then the default color will be used.intensityis a real non-negative number defaulting to ‘1’.

`light:ambient`

returns a light source or sources ofcolorwith total strength ofintensity(or 1 if omitted).

— Function: **light:directional**` color direction intensity`

— Function:**light:directional**` color direction`

— Function:**light:directional**` color`

— Function:

— Function:

Directional light shines parallel rays with uniform intensity on all objects with which it is grouped.

coloris a an object of type color, a 24-bit sRGB integer, or a list of 3 numbers between 0.0 and 1.0. Ifcoloris #f, then the default color will be used.

directionmust be a list or vector of 2 or 3 numbers specifying the direction to this light. Ifdirectionhas 2 numbers, then these numbers are the angle from zenith and the azimuth in degrees; ifdirectionhas 3 numbers, then these are taken as a Cartesian vector specifying the direction to the light source. The default direction is upwards; thus its light will shine down.

intensityis a real non-negative number defaulting to ‘1’.

`light:directional`

returns a light source or sources ofcolorwith total strength ofintensity, shining fromdirection.

— Function: **light:beam**` attenuation radius aperture peak`

— Function:**light:beam**` attenuation radius aperture`

— Function:**light:beam**` attenuation radius`

— Function:**light:beam**` attenuation`

— Function:

— Function:

— Function:

attenuationis a list or vector of three nonnegative real numbers specifying the reduction of intensity, the reduction of intensity with distance, and the reduction of intensity as the square of distance.radiusis the distance beyond which the light does not shine.radiusdefaults to ‘100’.

apertureis a real number between 0 and 180, the angle centered on the light's axis through which it sheds some light.peakis a real number between 0 and 90, the angle of greatest illumination.

— Function: **light:point**` location color intensity beam`

— Function:**light:point**` location color intensity`

— Function:**light:point**` location color`

— Function:**light:point**` location`

— Function:

— Function:

— Function:

Point light radiates from

location, intensity decreasing with distance, towards all objects with which it is grouped.

coloris a an object of type color, a 24-bit sRGB integer, or a list of 3 numbers between 0.0 and 1.0. Ifcoloris #f, then the default color will be used.intensityis a real non-negative number defaulting to ‘1’.beamis a structure returned by`light:beam`

or #f.

`light:point`

returns a light source or sources atlocationofcolorwith total strengthintensityandbeamproperties. Note that the pointlight itself is not visible. To make it so, place an object with emissive appearance atlocation.

— Function: **light:spot**` location direction color intensity beam`

— Function:**light:spot**` location direction color intensity`

— Function:**light:spot**` location direction color`

— Function:**light:spot**` location direction`

— Function:**light:spot**` location`

— Function:

— Function:

— Function:

— Function:

Spot light radiates from

locationtowardsdirection, intensity decreasing with distance, illuminating objects with which it is grouped.

directionmust be a list or vector of 2 or 3 numbers specifying the direction to this light. Ifdirectionhas 2 numbers, then these numbers are the angle from zenith and the azimuth in degrees; ifdirectionhas 3 numbers, then these are taken as a Cartesian vector specifying the direction to the light source. The default direction is upwards; thus its light will shine down.

coloris a an object of type color, a 24-bit sRGB integer, or a list of 3 numbers between 0.0 and 1.0. Ifcoloris #f, then the default color will be used.

intensityis a real non-negative number defaulting to ‘1’.

`light:spot`

returns a light source or sources atlocationofdirectionwith total strengthcolor. Note that the spotlight itself is not visible. To make it so, place an object with emissive appearance atlocation.

— Function: **solid:box**` geometry appearance`

— Function:**solid:box**` geometry`

— Function:

geometrymust be a number or a list or vector of three numbers. Ifgeometryis a number, the`solid:box`

returns a cube with sides of lengthgeometrycentered on the origin. Otherwise,`solid:box`

returns a rectangular box with dimensionsgeometrycentered on the origin.appearancedetermines the surface properties of the returned object.

— Function: **solid:lumber**` geometry appearance`

Returns a box of the specified

geometry, but with the y-axis of a texture specified inappearancebeing applied along the longest dimension ingeometry.

— Function: **solid:cylinder**` radius height appearance`

— Function:**solid:cylinder**` radius height`

— Function:

Returns a right cylinder with dimensions

`(abs`

radius`)`

and`(abs`

height`)`

centered on the origin. Ifheightis positive, then the cylinder ends will be capped. Ifradiusis negative, then only the ends will appear.appearancedetermines the surface properties of the returned object.

— Function: **solid:disk**` radius thickness appearance`

— Function:**solid:disk**` radius thickness`

— Function:

thicknessmust be a positive real number.`solid:disk`

returns a circular disk with dimensionsradiusandthicknesscentered on the origin.appearancedetermines the surface properties of the returned object.

— Function: **solid:cone**` radius height appearance`

— Function:**solid:cone**` radius height`

— Function:

Returns an isosceles cone with dimensions

radiusandheightcentered on the origin.appearancedetermines the surface properties of the returned object.

— Function: **solid:pyramid**` side height appearance`

— Function:**solid:pyramid**` side height`

— Function:

Returns an isosceles pyramid with dimensions

sideandheightcentered on the origin.appearancedetermines the surface properties of the returned object.

— Function: **solid:sphere**` radius appearance`

— Function:**solid:sphere**` radius`

— Function:

Returns a sphere of radius

radiuscentered on the origin.appearancedetermines the surface properties of the returned object.

— Function: **solid:ellipsoid**` geometry appearance`

— Function:**solid:ellipsoid**` geometry`

— Function:

geometrymust be a number or a list or vector of three numbers. Ifgeometryis a number, the`solid:ellipsoid`

returns a sphere of diametergeometrycentered on the origin. Otherwise,`solid:ellipsoid`

returns an ellipsoid with diametersgeometrycentered on the origin.appearancedetermines the surface properties of the returned object.

— Function: **solid:polyline**` coordinates appearance`

— Function:**solid:polyline**` coordinates`

— Function:

coordinatesmust be a list or vector of coordinate lists or vectors specifying the x, y, and z coordinates of points.`solid:polyline`

returns lines connecting successive pairs of points. If called with one argument, then the polyline will be white. Ifappearanceis given, then the polyline will have its emissive color only; being black ifappearancedoes not have an emissive color.The following code will return a red line between points at

`(1 2 3)`

and`(4 5 6)`

:(solid:polyline '((1 2 3) (4 5 6)) (solid:color #f 0 #f 0 '(1 0 0)))

— Function: **solid:prism**` xz-array y appearance`

— Function:**solid:prism**` xz-array y`

— Function:

xz-arraymust be ann-by-2 array holding a sequence of coordinates tracing a non-intersecting clockwise loop in the x-z plane.`solid:prism`

will close the sequence if the first and last coordinates are not the same.

`solid:prism`

returns a capped prismylong.

— Function: **solid:basrelief**` width height depth colorray appearance`

— Function:**solid:basrelief**` width height depth appearance`

— Function:**solid:basrelief**` width height depth`

— Function:

— Function:

One of

width,height, ordepthmust be a 2-dimensional array; the others must be real numbers giving the length of the basrelief in those dimensions. The rest of this description assumes thatheightis an array of heights.

`solid:basrelief`

returns awidthbydepthbasrelief solid with heights per arrayheightwith the buttom surface centered on the origin.If present,

appearancedetermines the surface properties of the returned object. If present,colorraymust be an array of objects of type color, 24-bit sRGB integers or lists of 3 numbers between 0.0 and 1.0.If

colorray's dimensions matchheight, then each element ofcolorraypaints its corresponding vertex ofheight. Ifcolorrayhas all dimensions one smaller thanheight, then each element ofcolorraypaints the corresponding face ofheight. Other dimensions forcolorrayare in error.

— Function: **solid:text**` fontstyle str len appearance`

— Function:**solid:text**` fontstyle str len`

— Function:

fontstylemust be a value returned by`solid:font`

.

strmust be a string or list of strings.

lenmust be #f, a nonnegative integer, or list of nonnegative integers.

appearance, if given, determines the surface properties of the returned object.

`solid:text`

returns a two-sided, flat text object positioned in the Z=0 plane of the local coordinate system

— Function: **solid:color**` diffuseColor ambientIntensity specularColor shininess emissiveColor transparency`

— Function:**solid:color**` diffuseColor ambientIntensity specularColor shininess emissiveColor`

— Function:**solid:color**` diffuseColor ambientIntensity specularColor shininess`

— Function:**solid:color**` diffuseColor ambientIntensity specularColor`

— Function:**solid:color**` diffuseColor ambientIntensity`

— Function:**solid:color**` diffuseColor`

— Function:

— Function:

— Function:

— Function:

— Function:

Returns an appearance, the optical properties of the objects with which it is associated.

ambientIntensity,shininess, andtransparencymust be numbers between 0 and 1.diffuseColor,specularColor, andemissiveColorare objects of type color, 24-bit sRGB integers or lists of 3 numbers between 0.0 and 1.0. If a color argument is omitted or #f, then the default color will be used.

— Function: **solid:texture**` image color scale rotation center translation`

— Function:**solid:texture**` image color scale rotation center`

— Function:**solid:texture**` image color scale rotation`

— Function:**solid:texture**` image color scale`

— Function:**solid:texture**` image color`

— Function:**solid:texture**` image`

— Function:

— Function:

— Function:

— Function:

— Function:

Returns an appearance, the optical properties of the objects with which it is associated.

imageis a string naming a JPEG or PNG image resource.coloris #f, a color, or the string returned by`solid:color`

. The rest of the optional arguments specify 2-dimensional transforms applying to theimage.

scalemust be #f, a number, or list or vector of 2 numbers specifying the scale to apply toimage.rotationmust be #f or the number of degrees to rotateimage.centermust be #f or a list or vector of 2 numbers specifying the center ofimagerelative to theimagedimensions.translationmust be #f or a list or vector of 2 numbers specifying the translation to apply toimage.

— Function: **solid:font**` family style justify size spacing language direction`

Returns a fontstyle object suitable for passing as an argument to

`solid:text`

. Any of the arguments may be #f, in which case its default value, which is first in each list of allowed values, is used.

familyis a case-sensitive string naming a font; ‘SERIF’, ‘SANS’, and ‘TYPEWRITER’ are supported at the minimum.

styleis a case-sensitive string ‘PLAIN’, ‘BOLD’, ‘ITALIC’, or ‘BOLDITALIC’.

justifyis a case-sensitive string ‘FIRST’, ‘BEGIN’, ‘MIDDLE’, or ‘END’; or a list of one or two case-sensitive strings (same choices). The mechanics ofjustifyget complicated; it is explained by tables 6.2 to 6.7 of http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-IS-VRML97WithAmendment1/part1/nodesRef.html#Table6.2

sizeis the extent, in the non-advancing direction, of the text.sizedefaults to 1.

spacingis the ratio of the line (or column) offset tosize.spacingdefaults to 1.

languageis the RFC-1766 language name.

directionis a list of two numbers:`(`

x

y`)`

. If`(> (abs`

x`) (abs`

y`))`

, then the text will be arrayed horizontally; otherwise vertically. The direction in which characters are arrayed is determined by the sign of the major axis: positivexbeing left-to-right; positiveybeing top-to-bottom.

— Function: **solid:center-row-of**` number solid spacing`

Returns a row of

numbersolidobjects spaced evenlyspacingapart.

— Function: **solid:center-array-of**` number-a number-b solid spacing-a spacing-b`

Returns

number-brows,spacing-bapart, ofnumber-asolidobjectsspacing-aapart.

— Function: **solid:center-pile-of**` number-a number-b number-c solid spacing-a spacing-b spacing-c`

Returns

number-cplanes,spacing-capart, ofnumber-brows,spacing-bapart, ofnumber-asolidobjectsspacing-aapart.

— Function: **solid:arrow**` center`

centermust be a list or vector of three numbers. Returns an upward pointing metallic arrow centered atcenter.

— Function: **solid:translation**` center solid ...`

centermust be a list or vector of three numbers.`solid:translation`

Returns an aggregate ofsolids, ... with their origin moved tocenter.