<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>gleSpiral</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GLE.xml" title="GLE"/><link rel="previous" href="gleSetNumSides.3GLE.xml" title="gleSetNumSides"/><link rel="next" href="gleSuperExtrusion.3GLE.xml" title="gleSuperExtrusion"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gleSpiral</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="gleSetNumSides.3GLE.xml">Prev</a> </td><th width="60%" align="center">GLE</th><td width="20%" align="right"> <a accesskey="n" href="gleSuperExtrusion.3GLE.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="gleSpiral.3GLE"/><div class="titlepage"/><div class="refnamediv"><a name="gleSpiral.3GLE-name"/><h2>Name</h2><p>gleSpiral &#8212; Sweep an arbitrary contour along a helical path.</p></div><div class="refsynopsisdiv"><a name="gleSpiral.3GLE-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>gleSpiral</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>int <i><tt>ncp</tt></i>, gleDouble <i><tt>contour</tt></i>[][2], gleDouble <i><tt>cont_normal</tt></i>[][2], gleDouble <i><tt>up</tt></i>[3], gleDouble <i><tt>startRadius</tt></i>, gleDouble <i><tt>drdTheta</tt></i>, gleDouble <i><tt>startZ</tt></i>, gleDouble <i><tt>dzdTheta</tt></i>, gleDouble <i><tt>startXform</tt></i>[2][3], gleDouble <i><tt>dXformdTheta</tt></i>[2][3], gleDouble <i><tt>startTheta</tt></i>, gleDouble <i><tt>sweepTheta</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="gleSpiral.3GLE-python_specification"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>gleSpiral</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>contour</tt></i>[][2], <i><tt>cont_normal</tt></i>[][2], <i><tt>up</tt></i>[3], <i><tt>startRadius</tt></i>, <i><tt>drdTheta</tt></i>, <i><tt>startZ</tt></i>, <i><tt>dzdTheta</tt></i>, <i><tt>startXform</tt></i>[2][3], <i><tt>dXformdTheta</tt></i>[2][3], <i><tt>startTheta</tt></i>, <i><tt>sweepTheta</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="gleSpiral.3GLE-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>ncp</tt></i></span></dt><dd>
						number of contour points
					</dd><dt><span class="term"><i><tt>contour</tt></i></span></dt><dd>
						2D contour
					</dd><dt><span class="term"><i><tt>cont_normal</tt></i></span></dt><dd>
						2D contour normals
					</dd><dt><span class="term"><i><tt>up</tt></i></span></dt><dd>
						up vector for contour
					</dd><dt><span class="term"><i><tt>startRadius</tt></i></span></dt><dd>
						spiral starts in x-y plane
					</dd><dt><span class="term"><i><tt>drdTheta</tt></i></span></dt><dd>
						change in radius per revolution
					</dd><dt><span class="term"><i><tt>startZ</tt></i></span></dt><dd>
						starting z value
					</dd><dt><span class="term"><i><tt>dzdTheta</tt></i></span></dt><dd>
						change in Z per revolution
					</dd><dt><span class="term"><i><tt>startXform</tt></i></span></dt><dd>
						starting contour affine transformation
					</dd><dt><span class="term"><i><tt>dXformdTheta</tt></i></span></dt><dd>
						tangent change xform per revolution
					</dd><dt><span class="term"><i><tt>startTheta</tt></i></span></dt><dd>
						start angle in x-y plane
					</dd><dt><span class="term"><i><tt>sweepTheta</tt></i></span></dt><dd>
						degrees to spiral around
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="gleSpiral.3GLE-description"/><h2>Description</h2><p>
			Sweep an arbitrary contour along a helical path.
		</p><p>
			The axis of the helix lies along the modeling coordinate z-axis.
		</p><p>
			An affine transform can be applied as the contour is swept. For most ordinary usage, the affines should be given as
			<tt>NULL</tt>.
		</p><p>
			The <i><tt>startXform</tt></i> is an affine matrix applied to the contour to deform the contour. Thus,
			<i><tt>startXform</tt></i> of the form
		</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
				<mml:mfenced separator=",">
					<mml:mtable>
						<mml:mtr>
							<mml:mtd>
								<mml:mi>cos</mml:mi>
							</mml:mtd>
							<mml:mtd>
								<mml:mi>sin</mml:mi>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
						<mml:mtr>
							<mml:mtd>
								<mml:mo>-</mml:mo>
								<mml:mo>sin</mml:mo>
							</mml:mtd>
							<mml:mtd>
								<mml:mi>cos</mml:mi>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
					</mml:mtable>
				</mml:mfenced>
			</mml:math></div><p>
			will rotate the contour (in the plane of the contour), while
		</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
				<mml:mfenced separator=",">
					<mml:mtable>
						<mml:mtr>
							<mml:mtd>
								<mml:mn>1</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mi>tx</mml:mi>
							</mml:mtd>
						</mml:mtr>
						<mml:mtr>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>1</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mi>ty</mml:mi>
							</mml:mtd>
						</mml:mtr>
					</mml:mtable>
				</mml:mfenced>
			</mml:math></div><p>
			will translate the contour, and
		</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
				<mml:mfenced separator=",">
					<mml:mtable>
						<mml:mtr>
							<mml:mtd>
								<mml:mi>sx</mml:mi>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
						<mml:mtr>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mi>sy</mml:mi>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
					</mml:mtable>
				</mml:mfenced>
			</mml:math></div><p>
			scales along the two axes of the contour. In particular, note that
		</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
				<mml:mfenced separator=",">
					<mml:mtable>
						<mml:mtr>
							<mml:mtd>
								<mml:mn>1</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
						<mml:mtr>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>1</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
					</mml:mtable>
				</mml:mfenced>
			</mml:math></div><p>
			is the identity matrix. The <i><tt>dXformdTheta</tt></i> is a differential affine matrix that is integrated
			while the contour is extruded. Note that this affine matrix lives in the tangent space, and so it should have the form
			of a generator. Thus, dx/dt's of the form
		</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
				<mml:mfenced separator=",">
					<mml:mtable>
						<mml:mtr>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mi>r</mml:mi>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
						<mml:mtr>
							<mml:mtd>
								<mml:mo>-</mml:mo>
								<mml:mi>r</mml:mi>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
					</mml:mtable>
				</mml:mfenced>
			</mml:math></div><p>
			rotate the the contour as it is extruded (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>r</mml:mi>
					<mml:mo>&#8801;</mml:mo>
					<mml:mn>0</mml:mn>
				</mml:math> implies no rotation, <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>r</mml:mi>
					<mml:mo>&#8801;</mml:mo>
					<mml:mn>2</mml:mn>
					<mml:mi>&#960;</mml:mi>
				</mml:math> implies that the contour is rotated once, etc.), while
		</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
				<mml:mfenced separator=",">
					<mml:mtable>
						<mml:mtr>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mi>tx</mml:mi>
							</mml:mtd>
						</mml:mtr>
						<mml:mtr>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mi>ty</mml:mi>
							</mml:mtd>
						</mml:mtr>
					</mml:mtable>
				</mml:mfenced>
			</mml:math></div><p>
			translates the contour, and
		</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
				<mml:mfenced separator=",">
					<mml:mtable>
						<mml:mtr>
							<mml:mtd>
								<mml:mi>sx</mml:mi>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
						<mml:mtr>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mi>sy</mml:mi>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
					</mml:mtable>
				</mml:mfenced>
			</mml:math></div><p>
			scales it. In particular, note that
		</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
				<mml:mfenced separator=",">
					<mml:mtable>
						<mml:mtr>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
						<mml:mtr>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
							<mml:mtd>
								<mml:mn>0</mml:mn>
							</mml:mtd>
						</mml:mtr>
					</mml:mtable>
				</mml:mfenced>
			</mml:math></div><p>
			is the identity matrix &#8212; i.e. the derivatives are zero, and therefore the integral is a constant.
		</p></div><div class="refsect1" lang="en"><a name="gleSpiral.3GLE-see_also"/><h2>See Also</h2><p>
			<a href="gleLathe.3GLE.xml">gleLathe</a>
		</p></div><div class="refsect1" lang="en"><a name="gleSpiral.3GLE-author"/><h2>Author</h2><p>
			Linas Vepstas
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gleSetNumSides.3GLE.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GLE.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="gleSuperExtrusion.3GLE.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gleSetNumSides </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> gleSuperExtrusion</td></tr></table></div></body></html>