<?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>gluBeginTrim</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-GLU.xml" title="GLU"/><link rel="previous" href="gluBeginSurface.3G.xml" title="gluBeginSurface"/><link rel="next" href="gluBuild1DMipmapLevels.3G.xml" title="gluBuild1DMipmapLevels"/></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">gluBeginTrim</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="gluBeginSurface.3G.xml">Prev</a> </td><th width="60%" align="center">GLU</th><td width="20%" align="right"> <a accesskey="n" href="gluBuild1DMipmapLevels.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="gluBeginTrim.3G"/><div class="titlepage"/><div class="refnamediv"><a name="gluBeginTrim.3G-name"/><h2>Name</h2><p>gluBeginTrim, gluEndTrim &#8212; delimit a NURBS trimming loop definition</p></div><div class="refsynopsisdiv"><a name="gluBeginTrim.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>gluBeginTrim</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLUnurbs* <i><tt>nurb</tt></i>);</code></td></tr><tr><td valign="top"><code>void <tt>gluEndTrim</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLUnurbs* <i><tt>nurb</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="gluBeginTrim.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>gluBeginTrim</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>nurb</tt></i>) &#8594; <tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>gluEndTrim</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>nurb</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="gluBeginTrim.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>nurb</tt></i></span></dt><dd>
						Specifies the NURBS object (created with <a href="gluNewNurbsRenderer.3G.xml"><tt>gluNewNurbsRenderer</tt></a>).
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="gluBeginTrim.3G-description"/><h2>Description</h2><p>
			Use <tt>gluBeginTrim</tt> to mark the beginning of a trimming loop, and <tt>gluEndTrim</tt> to
			mark the end of a trimming loop. A trimming loop is a set of oriented curve segments (forming a closed curve) that
			define boundaries of a NURBS surface. You include these trimming loops in the definition of a NURBS surface, between
			calls to <a href="gluBeginSurface.3G.xml"><tt>gluBeginSurface</tt></a> and <a href="gluBeginSurface.3G.xml"><tt>gluEndSurface</tt></a>.
		</p><p>
			The definition for a NURBS surface can contain many trimming loops. For example, if you wrote a definition for a NURBS
			surface that resembled a rectangle with a hole punched out, the definition would contain two trimming loops. One loop
			would define the outer edge of the rectangle; the other would define the hole punched out of the rectangle. The
			definitions of each of these trimming loops would be bracketed by a
			<tt>gluBeginTrim</tt>/<tt>gluEndTrim</tt> pair.
		</p><p>
			The definition of a single closed trimming loop can consist of multiple curve segments, each described as a piecewise
			linear curve (see <a href="gluPwlCurve.3G.xml">gluPwlCurve</a>) or as a single NURBS curve (see <a href="gluNurbsCurve.3G.xml"><tt>gluNurbsCurve</tt></a>), or as a
			combination of both in any order. The only library calls that can appear in a trimming loop definition (between the
			calls to <tt>gluBeginTrim</tt> and <tt>gluEndTrim</tt>) are <a href="gluPwlCurve.3G.xml"><tt>gluPwlCurve</tt></a> and <a href="gluNurbsCurve.3G.xml"><tt>gluNurbsCurve</tt></a>.
		</p><p>
			The area of the NURBS surface that is displayed is the region in the domain to the left of the trimming curve as the
			curve parameter increases. Thus, the retained region of the NURBS surface is inside a counterclockwise trimming loop
			and outside a clockwise trimming loop. For the rectangle mentioned earlier, the trimming loop for the outer edge of the
			rectangle runs counterclockwise, while the trimming loop for the punched-out hole runs clockwise.
		</p><p>
			If you use more than one curve to define a single trimming loop, the curve segments must form a closed loop (that is,
			the endpoint of each curve must be the starting point of the next curve, and the endpoint of the final curve must be
			the starting point of the first curve). If the endpoints of the curve are sufficiently close together but not exactly
			coincident, they will be coerced to match. If the endpoints are not sufficiently close, an error results (see <a href="gluNurbsCallback.3G.xml"><tt>gluNurbsCallback</tt></a>).
		</p><p>
			If a trimming loop definition contains multiple curves, the direction of the curves must be consistent (that is, the
			inside must be to the left of all of the curves). Nested trimming loops are legal as long as the curve orientations
			alternate correctly. If trimming curves are self-intersecting, or intersect one another, an error results.
		</p><p>
			If no trimming information is given for a NURBS surface, the entire surface is drawn.
		</p></div><div class="refsect1" lang="en"><a name="gluBeginTrim.3G-example"/><h2>Example</h2><p>
			This code fragment defines a trimming loop that consists of one piecewise linear curve, and two NURBS curves:
		</p><pre class="programlisting">gluBeginTrim(nobj);
gluPwlCurve(..., GLU_MAP1_TRIM_2);
gluNurbsCurve(..., GLU_MAP1_TRIM_2);
gluNurbsCurve(..., GLU_MAP1_TRIM_3);
gluEndTrim(nobj);</pre></div><div class="refsect1" lang="en"><a name="gluBeginTrim.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="gluBeginSurface.3G.xml">gluBeginSurface</a>, <a href="gluNewNurbsRenderer.3G.xml">gluNewNurbsRenderer</a>, <a href="gluNurbsCallback.3G.xml">gluNurbsCallback</a>, <a href="gluNurbsCurve.3G.xml">gluNurbsCurve</a>, <a href="gluPwlCurve.3G.xml">gluPwlCurve</a></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gluBeginSurface.3G.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GLU.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="gluBuild1DMipmapLevels.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gluBeginSurface </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> gluBuild1DMipmapLevels</td></tr></table></div></body></html>
