5.59. Spiral (media-object)

<spiral> ‐ A horizontal spiral (parallel to the xOz plane).

5.59.1. Attributes

NameTypeDefaults
idID0.0
radiusFLOAT0.0
radiusGrowthFLOAT0.0
axisGrowthFLOAT0.0
rotationNumberFLOAT1.0
typeSTRINGlinear-spiral
angleFLOAT0.0
widthFLOAT0.0
xFLOAT0.0
yFLOAT0.0
zFLOAT0.0

5.59.2. Description

This element describe a spiral with an axis parallel to the y coordinate axis. It is used either as an autonomous geometrical component in a scene, or as a spiraled path in a spiral transformation. Two types of spirals are described: spirals with exponentially varying values of the height and radius, and spirals with linear growth of these values. The leftmost spiral in Figure 5-22 is an exponential spiral whose coefficient for radius growth is negative (-1.04), and coefficient for axis growth is positive (1.07). The rightmost spiral in Figure 5-22 is a linear spiral whose coefficient for radius growth is negative (-0.1), and coefficient for axis growth is positive (0.2).

Figure 5-22. Spiral components

The string value of the type attribute is equal to linear-spiral or exponential-spiral depending on the spiral type. The float values of the x, y, and z attributes define the coordinates xC, zC, and zC of the spiral center C. The float value R0 of the radius attribute defines the initial radius. The float values of the radiusGrowth and axisGrowth attributes define the variation of the radius and height as a function of the angle A from the initial position angle (the value of the angle attribute) to the current location (Figure 5-23).

Figure 5-23. Spiral components

The float value of the width attribute defines the width of the spiral; it must be set to 0 for an invisible spiral. The float value of the rotationNumber attribute defines the length of the spiral as a fractional number of of rotations (it must be multiplied by 360 degrees to obtain the actual angle). The integer value of the segments attribute is the number of steps that will be used to build the mesh of the spiral when rendering it.

5.59.3. Expected child

None.

5.59.4. Example

The example below define the tow spirals drawn in Figure 5-22. They a both centered at the origin, and have 6 turns around the y axis and start at angle 30°.

<spiral id="spiral1" type="linear-spiral" radius="5"
        radiusGrowth="-0.1" angle="0" axisGrowth="0.3" width="0.3"  
        rotationNumber="6.0" segments="100" x="0" y="0" z="0" />

<spiral id="spiral1" type="exponential-spiral" radius="9"
        radiusGrowth="-1.04" angle="0" axisGrowth="1.07" width="0.1" 
        rotationNumber="6.0" x="0" y="0" z="0" segments="100"/>