<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/pattern.xsl"?>
<pattern id="">
  <name>Jig</name>
  <patternAlias>Strut</patternAlias>
  <patternAlias>Reference</patternAlias>
  <relatedPatterns>
    <relatedPattern ref="">
	<patternLink>Controller</patternLink>
    </relatedPattern>
    <relatedPattern ref="">
	<patternLink>Mapping</patternLink>
    </relatedPattern>
    <relatedPattern ref="">
	<patternLink>Organized Collection of Points</patternLink>
    </relatedPattern>
  </relatedPatterns>

  <web>
    <diagram>
		<web>
      <img src="DiagramJig.gif" width="400" />
	  </web>
	<latex>
      <img src="DiagramJig.jpg" width="400" />
	  </latex>
    </diagram>
  </web>
  <latex>

  \pbOneCol[r]
    {\pbIncludeGraphics[\extImagesPath/VikingShipSculpture.jpg]{width=\currentWidth}
    \source{Amy Taylor}}
  </latex>
  <what>
    <paragraph>
      Build simple abstract frameworks to isolate structure and
      location from geometric detail.
    </paragraph>

  </what>
  <when>
    <paragraph>
      Designers sketch. Carpenters make jigs. These acts share intent;
      they both abstract away inessential detail, leaving a simple
      framework that can be easily changed. Design sketches express
      structure and form. Carpenters' jigs fix locations and tool paths
      in space. A parametric <patternName>Jig</patternName> mixes both
      of these traditions. Use this pattern when you want to quickly
      make and modify a simple version of your design and develop
      detail later.
    </paragraph>
  </when>
  <why>
    <paragraph>
      Most models contain many elements and few controls. The logic of
      the controls is typically simple. A
      <patternName>Jig</patternName> is a simplified model that allows
      you to understand how the controls work without the distracting
      detail and slow interaction implied by a larger
      model. <patternName>Jigs</patternName> can be changed easily
      compared to complex models. Once developed, a
      <patternName>Jig</patternName> can be reused in other contexts,
      but only if it is can be isolated from the rest of the model.
      <patternName>Jigs</patternName> are like abstracting
      controllers, but are more specialized (they abstract a
      particular design), typically describe the whole design and are
      embedded within the design rather than being separated from
      it. The design is built directly on top of the <patternName>Jig</patternName>
    </paragraph>
  </why>
  <how>
    <paragraph>
      A <patternName>Jig</patternName> should appear and behave like a
      simplified version of your end goal. An physical example is the
      strongback and stations used in building a small boat. The
      stations locate and support the hull when it is being
      constructed. Fairing, the process of making the hull smooth and
      continuous, can be done much more simply with stations than with
      a complete hull. <patternName>Jigs</patternName> are like
      construction lines in that they help locate elements. They are
      unlike such lines in that they are linked to the controls that
      enliven the parametric model.
    </paragraph>
    <paragraph>
      <patternName>Jigs</patternName> typically connect to the model
      they control more richly than controllers, but still with a
      limited number of links<latex>\index{graph!link}</latex>. Most of these links should come from
      \afit{sink} nodes<latex>\index{node!sink}</latex>. This is not necessity---it is good
      programming style. Non-sink nodes capture the internal logic of
      the <patternName>Jig</patternName>. Connections from other than
      sink nodes run the risk of becoming invalidated when the <patternName>Jig</patternName> is
      refactored. In fact, if a sink node of a
      <patternName>Jig</patternName> is not used in the model it
      serves, it probably should not be there and can be deleted.
    </paragraph>
    <paragraph>
      To make a <patternName>Jig</patternName>, you need to understand
      the parametric behaviour you want and how the
      <patternName>Jig</patternName> will be used to define the
      complete model. A good <patternName>Jig</patternName> typically
      has relatively few geometric inputs (for example, points, lines,
      planes, coordinate systems) and each of these is carefully
      named. The small number of geometric inputs allows you to easily
      locate the <patternName>Jig</patternName>. The names<latex>\index{name}</latex> are the
      primary means by which you will understand the
      <patternName>Jig</patternName> when you (or someone else) reuse
      the <patternName>Jig</patternName> in the future.
    </paragraph>
    <paragraph>
      Use the internal structure of the <patternName>Jig</patternName>
      to capture intended logical behaviour For example, if the depth
      of a truss is proportional to its span, a
      <patternName>Jig</patternName> might comprise a line and a
      variable whose value is proportional to the length of the line.
    </paragraph>
  </how>
  <samples>
    <web>
    <sample id="">
      <name>Lift</name>
      <when>
	<paragraph> Use a moving point<latex>\index{point}</latex> to smoothly move each of a
	collection of points, which, in turn, define a surface<latex>\index{surface}</latex>.
      </paragraph>
      </when>
      <how>
	<paragraph>
	  Free form surfaces require a set of defining points, which
	  the surface's control net. They are the sink nodes of this
	  <patternName>Jig</patternName> and the main intent behind
	  its structure.  Each of the points are responsive to the
	  controlling point. To create such a set, start with two
	  simple points. Create a line<latex>\index{line}</latex>, starting from one point
	  and having a length that varies inversely with the distance
	  between the two points. The actual function by  which the
	  length varies can be crucial. The
	  <patternLink>Mapping</patternLink> pattern shows how to
	  clearly specify and control such functions.  
	</paragraph>
	<paragraph>
	  Call the start point of the line the <em>reference</em>
	  and the other point the <em>controller.</em> The length of
	  the line is given by any function that reduces as its input
	  grows. For example 

	  <math latex = "1/(\afFunc{Distance}{controller, reference}+0.1)">1/Distance(controller,reference)</math> 
	  or 
	  <math latex="10-{\afFunc{Distance}{controller, reference}}">10-Distance(controller,reference)</math>. Replicate the start point and hide
	  it. The model now has a set of lines that react to the
	  movement of the controller. Each of these lines acts as a
	  <patternName>Jig</patternName> to mark the form of the
	  future surface. In the final step, use the end points of the
	  <patternName>Jig</patternName> lines as the surface<latex>\index{surface}</latex> control
	  net.
	</paragraph>
	<paragraph>
	  <latex>
	    \begin{bodyNote}
 	      \pbOneCol
	        {\tikzPlaceHolder[Explanatory figure here]{\currentWidth}{\currentWidth*0.75}}
	    \end{bodyNote}
	  </latex>
	</paragraph>
      </how>
      <file href="Samples/JigLift/JigLift.gct"/>
      <animation src="Samples/JigLift/AnimationLift.swf"/>
    </sample>
    </web>
    <sample id="">
      <name>Controlled Surface Variation</name>
      <when>
	<paragraph> 
	  Make surface variations starting from a surface with a
	  parabolic cross section. Use a
	  <patternName>Jig</patternName> to model variations in a
	  controlled way.
        </paragraph>
      </when>
      <how>
	<paragraph> 
	  Low order curves<latex>\index{curve}</latex> and
	  surfaces<latex>\index{surface}</latex> are easy to model and
	  provide visual regularity that is difficult to achieve with
	  higher orders. An order <math latex="3">3</math> curve can
	  be represented by a higher-order curve by locating the
	  control points of the higher order curve<latex>\index{curv!degree}</latex> in precise relation
	  to those of the lower order curve<latex>\index{curve!order}</latex>. In the curve literature
	  this is called <em>degree elevation.</em>
        </paragraph>
	<paragraph> 
	  A symmetric <patternName>Jig</patternName> comprising an
	  upright and a cross bar provides a simple set of parameters
	  that support controlled surface variations starting from a
	  parabolic curve (see (a) below). To generate the control
	  points of an identical order <math latex="4">4</math> curve
	  from those of an order <math latex="3">3</math> curve (see
	  (b)), divide the two sides of the order <math
	  latex="3">3</math> control polygon in the ratio of
	  <math>2:1</math> and <math>1:2</math> respectively. The
	  order <math latex="5">5</math> control polygon divides the
	  three sides of the <math latex="4">4</math> in the ratios
	  <math>3:1</math>, <math>2:2</math> and
	  <math>1:3</math>. Initially locate and size the cross bar to
	  give these ratios. Varying the ratios (d) produces symmetric
	  curves that are visually close to the parabola. Restoring
	  the cross bar settings to the above defaults restores the
	  initial parabolic surface section. This allows the designer
	  to vary the surface cross section in comparison to a known,
	  simple and potentially fabricatable form.
        </paragraph>
	<paragraph>
	  <latex>
	    \begin{bodyNote}
 	      \pbTwoCol
	        {\input{\GCFigsPath/Patterns/JigControlledSurfaceVariationExplainCore00.tex}}
	        {\currentWidth/2}
	        {\input{\GCFigsPath/Patterns/JigControlledSurfaceVariationExplainCore10.tex}}
	        {\currentWidth/2}
 	      \pbTwoCol{\textsf{(a)}}{\currentWidth/2}{\textsf{(b)}}{\currentWidth/2}
	      \pbTwoCol
	        {\input{\GCFigsPath/Patterns/JigControlledSurfaceVariationExplainCore20.tex}}
	        {\currentWidth/2}
	        {\input{\GCFigsPath/Patterns/JigControlledSurfaceVariationExplainCore30.tex}}
	        {\currentWidth/2}
 	      \pbTwoCol{\textsf{(c)}}{\currentWidth/2}{\textsf{(d)}}{\currentWidth/2}
	    \end{bodyNote}
      </latex>
	</paragraph>
      </how>
      <file href="Samples/JigControlledSurfaceVariation/JigControlledSurfaceVariation.gct"/>
<latex>      
<animation src="Samples/JigControlledSurfaceVariation/AnimationValleyRoof.swf"/>
</latex>  
  </sample>

    <sample id="">
      <name>Tube</name>
      <when><paragraph> Use the local properties of a curve<latex>\index{curve}</latex> to
      determine the local radius and orientiation of circular
      <patternName>Jigs</patternName>. Use the circles<latex>\index{circle}</latex> to define a
      tube. In turn use a curve as another
      <patternName>Jig</patternName> to apply a global form to the
      tube as a whole.
      </paragraph>
      </when>
      <how>
	<paragraph>
	  Start with a curve as the central path of the tube. See (a) below. It can
	  be specified by four points with almost arbitrary <math
	  latex = "x,">x,</math> <math latex = "y,">y,</math> and
	  <math latex = "z,">z,</math> coordinates. Along this path,
	  place a sequence of circles on planes perpendicular to
	  global <math latex = "y">y</math>-axis. The circles are
	  evenly distributed in parameter space, so the geometric
	  spacing between circles varies along the curve. Each circle
	  takes its radius from a property of its centrepoint, in this
	  case, the height above some external datum. In this sample,
	  the radius is the absolute value of the centrepoint's <math
	  latex = "z,">z,</math> value plus a small increment (to
	  avoid the possibility of a zero or negative radius). Since
	  these circles are the elements that construct the tube, they
	  comprise a <patternName>Jig</patternName>.
	</paragraph>
	<paragraph>
	  Now (b) <patternName>Jig</patternName> the
	  <patternName>Jig</patternName>. Make a simple curve using an
	  low-order
	  <latex>\bspline[.]</latex><web>B-Spline</web>. Substitute it
	  for the existing curve used to define the
	  <patternName>Jig</patternName>. The tube now reflects the
	  simple, strong geometry of the curve.
	</paragraph>
	<paragraph>
	  Make (c) arcs comprising those parts of the circle
	  <patternName>Jigs</patternName> that are above the <math
	  latex="xy">xy</math>-plane.
	</paragraph>
	<paragraph>
	  Lastly (d), change the planes on which the circle
	  <patternName>Jigs</patternName> lie to be perpendicular to
	  the defining curve, resulting in a subtle, but significant
	  change to the tube's form.
	</paragraph>
	<paragraph>
	  <latex>
	    \begin{bodyNote}
 	      \pbTwoCol
	        {\input{\GCFigsPath/Patterns/JigTubeExplain00.tex}}
	        {\currentWidth/2}
	        {\input{\GCFigsPath/Patterns/JigTubeExplain10.tex}}
	        {\currentWidth/2}
 	      \pbTwoCol{\textsf{(a)}}{\currentWidth/2}{\textsf{(b)}}{\currentWidth/2}
	      \pbTwoCol
	        {\input{\GCFigsPath/Patterns/JigTubeExplain20.tex}}
	        {\currentWidth/2}
	        {\input{\GCFigsPath/Patterns/JigTubeExplain30.tex}}
	        {\currentWidth/2}
 	      \pbTwoCol{\textsf{(c)}}{\currentWidth/2}{\textsf{(d)}}{\currentWidth/2}
	    \end{bodyNote}
	  </latex>
	</paragraph>
      </how>
      <a href="Samples/JigTube/JigTube.gct" >Download JigTube.gct</a>
      <animation src="Samples/JigTube/AnimationTube.swf"/>
    </sample>
    <sample id="">
      <name>Sheet</name>
      <when>
	<paragraph> 
	  Simplify controls for a surface<latex>\index{surface}</latex> by relating them to a quadrilateral<latex>\index{quadrilateral}</latex>.
	</paragraph>
      </when>
      <how>
	<paragraph>
	  Standard surface controls can provide too much
	  freedom. This sample reduces the control available to model
	  a surface by ensuring tangency<latex>\index{tangent}</latex> conditions at the corners. It
	  still provides a wide range of visually logical variation.
	</paragraph>
	<paragraph>
	  The <patternName>Jig</patternName> is hierarchical--it comprises <patternName>Jigs</patternName> built on
	  <patternName>Jigs</patternName>, as shown below. The first
	  <patternName>Jig</patternName> (a) is a quadrilateral, which may be planar or not. The
	  second <patternName>Jig</patternName> (b) has two parts. The
	  first comprises struts at each vertex perpendicular to the
	  local plane of the quadrilateral (the plane given by
	  the vertex and its predecessor and successor vertices). The
	  second adds coordinate systems at the end of each strut,
	  such that the
	  <math latex = "x">x</math>-axis of the system aligns with the
	  successor vertex and the <math latex = "y">y</math>-axis with the
	  predecessor vertex, but in the opposite direction (the
	  quadrilateral has right-hand
	  rule orientation, so the <math latex = "y">y</math>-axis follows the vector between
	  the predecessor vertex and the vertex itself). The third
	  <patternName>Jig</patternName> (c) comprises curves with end tangents defined by
	  the <math latex = "x">x</math>-  and <math latex = "y">y</math>-directions of the
	  coordinate systems. The result (d) is the surface
	  itself with the curves as its defining boundary. 
	</paragraph>
	<paragraph>
	  The controls for this <patternName>Jig</patternName> comprise the quadrilateral itself
	  and the four strut lengths. Each enters the system at a
	  different level of the <patternName>Jig</patternName>.
	</paragraph>
	<paragraph>
	  <latex>
	    \begin{bodyNote}
 	      \pbTwoCol
	        {\input{\GCFigsPath/Patterns/JigSheetExplain00.tex}}
	        {\currentWidth/2}
	        {\input{\GCFigsPath/Patterns/JigSheetExplain10.tex}}
	        {\currentWidth/2}
 	      \pbTwoCol{\textsf{(a)}}{\currentWidth/2}{\textsf{(b)}}{\currentWidth/2}
	      \pbTwoCol
	        {\input{\GCFigsPath/Patterns/JigSheetExplain20.tex}}
	        {\currentWidth/2}
	        {\input{\GCFigsPath/Patterns/JigSheetExplain30.tex}}
	        {\currentWidth/2}
 	      \pbTwoCol{\textsf{(c)}}{\currentWidth/2}{\textsf{(d)}}{\currentWidth/2}
	    \end{bodyNote}
      </latex>
	</paragraph>
      </how>
      <a href="Samples/JigSheet/JigSheet.gct" >Download JigSheet.gct</a>
      <animation src="Samples/JigSheet/AnimationSheet.swf"/>
    </sample>
    <sample id="">
      <name>Scallop</name>
      <when><paragraph> Use the shape of a scallop as a point of
      departure in a search for form. The actual
      surface<latex>\index{surface}</latex> will be analogous to, but not a copy of, a scallop.
      </paragraph>
      </when>
      <how>
	<paragraph>
	  In plan, the geometry of a scallop is approximately that of
	  a circular arc. The base of the scallop is a chord of the
	  arc. Any point on the edge of the circle<latex>\index{circle}</latex> will subtend a
	  constant angle with the base. 
	</paragraph>
	<paragraph>
	  The idea is to "open" up the base of the scallop---to turn
	  it from a line into a vertical rectangle. The
	  <patternName>Jig</patternName> is a sequence of triangles on
	  horizontal planes arrayed vertically from the base line. The
	  apex of each triangle is the projection of a point on the
	  circle onto the plane of the triangle<latex>\index{triangle}</latex>. There are three
	  constants here: angle subtended on the circle, spacing of
	  base points on the circle and vertical spacing of the jig
	  elements. <patternName>Controllers</patternName> could be
	  put on each of these to open a design space for the surface.
	</paragraph>
	  The generating triangles are actually modeled as order
	  <math>2</math> <latex>\bspline</latex><web>B-Spline</web> curves. This and the order of the
	  surface itself give two additional controls. The resulting
	  forms are far from the original scallop point of
	  departure. 
	<paragraph>
	</paragraph>
	<paragraph>
	  <web>
	    <img src="Samples/JigScallop/DiagramJigScallop01.jpg"  width="400" height="300" />
	  </web>
	  <latex>
             \begin{bodyNote}
               \pbOneCol[c]
                 {\input{\GCFigsPath/Patterns/JigScallopExplain00.tex}}
             \end{bodyNote}
      </latex>
	</paragraph>
      </how>
      <a href="Samples/JigScallop/JigScallop.gct" >Download JigScallop.gct</a>
      <animation src="Samples/JigScallop/AnimationScallop.swf"/>
    </sample>
  </samples>
</pattern>

