<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/pattern.xsl"?>
<pattern id="">
  <name>Place Holder</name>
  <relatedPatterns>
    <relatedPattern ref="">
	<patternLink>Organized Collection of Points</patternLink>
    </relatedPattern>
  </relatedPatterns>
  <diagram>
  <web><img src="DiagramPlHo.gif" width="400"/>
  </web>
  <latex>
    <img src="DiagramPlHo.pdf" width="400" height="300" />
	</latex>
  </diagram>
  <what>
    <paragraph>
      Use proxy objects to organize complex inputs when making
      collections.
      <latex>\label{sec:pattern:PlaceHolder}</latex>
    </paragraph>
  </what>
  <when>
    <paragraph>
      Designs have parts. Parametric modeling enables a single model to
      represent variations of a part, for example different window
      designs. Copying the model, one copy for each part, and
      adjusting the inputs to the copies is an effective
      strategy. Typically a part has multiple inputs---customizing
      each one is a lot of work. Use this pattern when you are able to
      describe the multiple inputs to an model through a smaller
      number (preferably one) of abstract proxy objects. 
    </paragraph>
  </when>
  <why>
    <paragraph>
      A very common situation is to array a complex module across a
      surface or along a set of curves. If this module requires
      multiple point-like inputs themselves defined on the target,
      organizing these inputs is sure to be complex and error
      prone. If you can define the inputs to the complex module
      through a simple construct such as a polygon<latex>\index{polygon}</latex>, it is often much
      easier to place the module. An arrangement of polygons on the
      goal surface creates proxies on which the module can be later
      (and easily) placed.
    </paragraph>
  </why>
  <how>
    <paragraph>
      <patternName>Place Holders</patternName> have two parts. The
      first is the proxy object itself: a simple object that carries
      the inputs for the module. For example, a rectangular module may
      require four input points, one for each corner. A four-sided
      polygon can act as a proxy for these points: each of the
      vertices of the polygon provides one of the points. The proxy
      simplifies the arguments needed for the module: instead of four
      points, use only one polygon. The second part relates the proxy
      object to the model. For example, a polygon proxy can be placed
      using a rectangular array of points by relating the <math latex
      = "ij^{th}">ij<sup>th</sup></math> polygon's vertices to the
      points <latex>$\afPt[p]_{i,j}, \afPt[p]_{i+1,j},
      \afPt[p]_{i+1,j+1} \afTMath{and}
      \afPt[p]_{i,j+1}$</latex><web>Pij, Pi+1j, Pi+1j+1 and
      Pij+1.</web>. The code placing a generic object such as a
      polygon is more simple and reusable than the code for a specific
      module.
    </paragraph>
  </how>
  <samples>
    <latex>\renewcommand{\sampleNewPage}[0]{false}</latex>
    <sample id="">
      <name>Hedgehog</name> 
    <when>
      <paragraph> 
	Use a collection of points as <patternName>Place
	Holders</patternName> to locate components (spines) that are
	perpendicular to a surface.
      </paragraph>
    </when>
      <how>
	<paragraph>
	  Every point<latex>\index{point}</latex> on a surface<latex>\index{surface}</latex> defines
	  a single frame<latex>\index{frame}</latex> comprising the
	  surface<latex>\index{surface!normal}</latex> normal and the two
	  vectors<latex>\index{vector}</latex> of principal
	  curvature<latex>\index{surface!curvature}</latex>. This <latex>\index{surface!principal
	  directions}</latex> is sufficient information to place and size spine-like objects on the
	  surface. The point provides location, the surface normal provides the direction for the
	  top of the spine and the vectors of principal curvature provide information for further
	  adapting the spine to context. Start with an <patternLink>Organized Collection of
	  Points</patternLink> defined by <math>u</math> and <math>v</math> parameters on the
	  surface. Instead of points, use coordinate systems---remember they have points inside
	  them! Each of the coordinate system<latex>\index{frame}</latex> points will serve as the
	  base of a spine. Define two graph variables <math latex="\afVar{count}">count</math> and
	  <math latex="\afVar{height}">height</math>. Use <math latex="\afVar{count}">count</math>
	  to control the <patternLink>Organized Collection of Points</patternLink> to produce <math
	  latex="\afVar{count}">count</math> coordinate systems in each parametric direction. At
	  each of the coordinate systems, use the <math latex="z">z</math>-direction of the
	  coordinate system and the parameter <math latex="\afVar{height}">height</math> to define a
	  cone.
	</paragraph>
        <paragraph>
	  <web>
	    <diagram>
	      <img src="Samples/PlHoHedgehog/Gruz_Anita_Martinz.jpg" width="400" height="300" />
	    </diagram>
	  </web>
	  <latex>
\begin{bodyNote}
  \pbOneCol[r]
    {\pbIncludeGraphics[Samples/PlHoHedgehog/Gruz_Anita_Martinz.jpg]{width=\currentWidth}
    \source{Anita Martinz}}
\end{bodyNote}	  
	  </latex>
	</paragraph>
      </how>

      <a href="Samples/PlHoHedgehog/PlHoHedgehog.gct" >Download PlHoHedgehog.gct</a> 
      <animation src="Samples/PlHoHedgehog/AnimationHedgehog.swf"/>
    </sample>
    <sample id="">
      <name>Truss</name> 
      <when>
	<paragraph> 
	  Use lines as <patternName>Place Holders</patternName> to
	  locate the members of a truss.
	</paragraph>
      </when>
      <how>
	<paragraph>
	  Each member of a truss might carry information such as the
	  section of the member its moment of inertia, material and
	  modulus of elasticity. In addition, the parametric model for
	  truss members may be able to shape its ends depending on the
	  context in which it is placed. Placing a truss member though
	  requires only the baseline along which the member
	  lies. First, develop a feature representing a truss member
	  and requiring only a line<latex>\index{line}</latex> as a geometric input. Second, (and
	  in a new model!) create an abstract truss comprising line
	  segments to represent the truss members. By applying the
	  truss member feature to these baseline <patternName>Place
	  Holders</patternName>, the detailed truss members are put in
	  place. This is, of course, a simplification of a real truss
	  member <patternName>Place Holder</patternName> in which the
	  truss member parametric model would need sufficient information to
	  shape its sectional properties end details. Taking this next step would require
	  that the <patternName>Place Holders</patternName> become
	  spatially more sophisticated and that the truss member
	  feature use that new information to specify its details.
	</paragraph>
		<paragraph>
	  <web>
	    <diagram>
	      <img src="Samples/PlHoTruss/firthofForth_Kenneth_Barker.jpg" width="400" height="300" />
	    </diagram>
	  </web>
	  <latex>
\begin{bodyNote}
  \pbOneCol[r]
    {\pbIncludeGraphics[Samples/PlHoTruss/firthofForth_Kenneth_Barker.jpg]{width=\currentWidth}
    \source{Kenneth Barker}}
\end{bodyNote}	  
	  </latex>
	</paragraph>
      </how>
      <a href="Samples/PlHoTruss/PlHoTrussBeam.gct" >Download PlHoTrussBeam.gct</a> <web>and</web> <a href="Samples/PlHoTruss/PlHoTrussSystem.gct" >PlHoTrussSystem.gct</a>
      <animation src="Samples/PlHoTruss/AnimationTruss.swf"/>
    </sample>
    <sample id="">
      <name>Paper Folding</name> 
      <when>
	<paragraph> Use quadrilaterals
      as <patternName>Place Holders</patternName> to simulate the
      paper folding effects in the following image.
      </paragraph>
      <paragraph>
	  <web>
	    <diagram>
	      <img src="Samples/PlHoPaperFolding/PlH0PaperFoldingImage.jpg" width="400" height="300" />
	    </diagram>
	  </web>
	  <latex>
\begin{bodyNote}
  \pbOneCol[r]
    {\pbIncludeGraphics[Samples/PlHoPaperFolding/PlH0PaperFoldingImage.jpg]{width=\currentWidth}
    \source{Zhenyu Qian}}
\end{bodyNote}	  
	  </latex>
      </paragraph>
      </when>
      <how>
	<paragraph>
	  Parametrically modeling folded paper is hard. The problem is
	  physics -- paper has actual dimensions and folds in it
	  constrain the spatial configurations it can achieve. These
	  real-world constraints inevitably imply that any model will
	  require the solution of simultaneous equations, which
	  propagation-based systems cannot do. (The <patternLink>Goal
	  Seeker</patternLink> pattern demonstrates a partial solution
	  to this problem.) That said, approximations can be useful in
	  design and this sample shows a way to simulate a folded
	  paper system, ceding from reality some dimensional variation
	  in the individual panels.
	</paragraph>
	<paragraph>
	  In a folded structure, the pattern of folds can be thought
	  of as separate from the size and location of the folded
	  panels. Further, the folding pattern will belong to one of
	  the <math latex="17">17</math> possible symmetry<latex>\index{symmetry}</latex> groups on
	  the plane (each group represents one of the fundamentally
	  different ways of arranging a collection of like motifs on
	  the plane <latex>(\citet[pp. 37-45]{GRUNBAUM1987};
	  \citet{Weisstein2009WallPaper})</latex>). In each such
	  group, there is a repeating module that imposes geometric
	  conditions on where the paper edge must be to connect to the
	  next module. The modeling task splits into three parts: the
	  paper folds, ensuring geometric connection at the joints and
	  arranging the resulting module across a surface.
	</paragraph>
	<paragraph>
	  The choice of module is key to clarity and simplicity. This
	  sample comprises a collection of identical
	  parallelograms (for symmetry aficiandos, arranged in symmetry group <math
	  latex="pmg">pmg</math> in crystallographic notation). It is
	  much simpler though to combine parts of six parallelograms<latex>\index{parallelogram}</latex>
	  to form a module that has simple translational symmetry
	  only (symmetry group <math latex="p1">p1</math>). Using two whole and four half
  parallelgrams defines a module in which it is easy (or at least,
  easier) to relate the geometric boundary conditions to the proxy <patternName>Place
	  Holder</patternName>.
	</paragraph>
	<paragraph>
	 <latex>
	    \begin{bodyNote}
	      \pbOneCol{\input{\GCFigsPath/Patterns/PlaceHolderPaperFoldingCell0.tex}}
	    \end{bodyNote}
	 </latex>
	 <web>
	   <diagram>
	     <img src="DiagramModule.jpg" width="400" height="300" />
	   </diagram>
	 </web>
	</paragraph>
	<paragraph>
	 To connect adjacent modules requires coincidence along each
	 edge and at each vertex at which modules join. Four edge
	 points connect two modules each and four vertex points
	 connect four modules each. The edge points are easy: they lie
	 at edge midpoints on the <patternName>Place
	 Holder,</patternName> so are guaranteed to coincide. Vertex
	 point coincidence requires that, at each vertex, adjacent
	 modules share a common vector from the vertex to the module
	 point. Here, this vector is computed as a global property of
	 the surface. With slightly more work, the <patternName>Place
	 Holder</patternName> object could hold individual direction vectors<latex>\index{vector!direction}</latex> at
            each of its vertices.
	</paragraph>
	<paragraph>
	  An <patternLink>Organized Collection of Points</patternLink>
	  using a rectangular grid of the <math latex="u">u</math> and
	  <math latex="v">v</math> parameters on a parametric surface
	  locates a collection of quadrilateral<latex>\index{quadrilateral}</latex> polygons<latex>\index{polygon}</latex>. Using these
	  quadrilaterals as <patternName>Place Holders</patternName>,
	  the surface gets covered by the folded modules and looks
	  like a folded paper sculpture. It isn't one of course: on a
	  general surface, edge lengths will differ from the initial
	  paper and polygons will not be planar. In more constrained
	  domains it is feasible to model folded paper. For instance,
	  the <patternLink>Goal Seeker</patternLink> pattern can be
	  used to find the feasible configurations for folding models
	  of Persian Rasmi domes<latex>\index{Rasmi dome}</latex> from single sheets of paper
	  <latex>\cite{Maleki2008A}</latex>.
	</paragraph>
	<latex>
	 \begin{bodyNote}
	  \pbTwoCol
	     {\pbIncludeGraphics[\extImagesPath/Rasmi/MalekiPaperDome.png]{width=\currentWidth/2}}
	     {\currentWidth/2}
	     {\pbIncludeGraphics[\extImagesPath/Rasmi/MalekiDome.png]{width=\currentWidth/2}}
	     {\currentWidth/2}
	     \figcaption{A dome structure folded from a planar assembly of triangles.
	     \source{Maryam Maleki}}
	 \end{bodyNote}
	</latex>
	<web>
	<diagram>
	  <img src="MalekiPaperDome.jpg" width="250"/>
	  <img src="MalekiDome.jpg" width="250" />
	</diagram>
	</web>
      </how>
      <a href="Samples/PlHoPaperFolding/PlHoPaperFolding01.gct"> Download PlHoPaperFolding01.gct</a>
      <web>and</web>
      <a href="Samples/PlHoPaperFolding/PlHoPaperFolding02.gct">PlHoPaperFolding02.gct</a>
      <animation src="Samples/PlHoPaperFolding/AnimationPaperFolding.swf"/>
    </sample>
	<web>
    <sample id="">
      <name>Mattress</name> <when><paragraph> Use octagons<latex>\index{octagon}</latex> and
      quadrilaterals<latex>\index{quadrilateral}</latex> as <patternName>Place Holders</patternName> to
      simulate the shape of an air mattress.
      </paragraph>
      </when>
      <how>
	<paragraph>
	  There are two special features in this sample.
	</paragraph>
	<paragraph>
	  1) There are two types of <patternName>Place
	  Holders</patternName>: the quadrilateral to place the rectangular
	  pillow and the octagon to place the octagonal pillow. 
	</paragraph>
	<paragraph>
	  2) The combined <patternName>Place Holder</patternName> is
	  hierarchical: one simple <patternName>Place
	  Holder</patternName> defines the actual <patternName>Place
	  Holders</patternName> containing both quadrilaterals and
	  octagons.  The first <patternName>Place Holder</patternName>
	  is the familiar one from previous samples: the
	  quadrilaterals created by <math latex="uv">uv</math> points
	  on the surface. This acts as a <patternName>Place
	  Holder</patternName> for placing octagon <patternName>Place
	  Holders</patternName> on face centres and quadrilateral
	  <patternName>Place Holders</patternName> on vertices.
	</paragraph>
	<paragraph>
	  Once the <patternName>Place Holder</patternName> structure
	  is complete, the two different modules are located on each
	  of the quadrilaterals and octagons respectively.
	</paragraph>
	<paragraph>
	  <latex>
	    \begin{bodyNote}
 	      \pbOneCol
	        {\tikzPlaceHolder[Explanatory figure here]{\currentWidth}{\currentWidth*0.75}}
	    \end{bodyNote}
	  </latex>
	</paragraph>
      </how>
      <a href="Samples/PlHoMattress/PlHoSqaurePillow.gct" >Download PlHoSquarePillow.gct</a><web>, </web> <a href="Samples/PlHoMattress/PlHoPolygonPillow.gct" >PlHoPolygonPillow.gct</a> <web> and </web> <a href="Samples/PlHoMattress/PlHoMattress.gct" >PlHoMattress.gct</a>
      <animation src="Samples/PlHoMattress/AnimationMattress.swf"/>
    </sample>
	</web>
  </samples>
</pattern>

