<!-- Converted by db4-upgrade version 1.0 -->

<article xmlns="http://docbook.org/ns/docbook" version="5.0">
  <info><title>Creating a Mug</title>
    

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../books/en/tutorial_series_authors.xml" xpointer="Intro_MGED_Tutorial_Series_II_authors"/>

    <legalnotice>
       <para>Approved for public release; distribution is unlimited</para>
   </legalnotice>
  </info>

    <para xml:id="creating_mug_overviewlist">
      In this lesson, you will:
      <itemizedlist mark="bullet">
	<listitem>
	  <para>Create an outside cylinder using the in command.</para>
	</listitem>
	<listitem>
	  <para>Create an inside cylinder for hollowing out the larger shape cylinder.</para>
	</listitem>
	<listitem>
	  <para>Create a handle for your mug.</para>
	</listitem>
	<listitem>
	  <para>Create a combination to produce the body of your mug.</para>
	</listitem>
	<listitem>
	  <para>Create a combination to join the handle to the body.</para>
	</listitem>
	<listitem>
	  <para>Create a region of combined shapes with the same material and color.</para>
	</listitem>
      </itemizedlist>
    </para>
    
    <para xml:id="creating_mug_intro1">
      In this lesson, you will be continuing your work creating real-life
      objects-in this case, the basic body shape of a coffee mug. In the next
      lesson, you will refine the body so that it is more realistic.
    </para>
    
    <section xml:id="mug_new_db"><info><title>Creating a New Database</title></info>
      
      <para>
	Create a new database and call it mug.g. Go back to the File menu and
	select Preferences, then Units, and then inches. This will create your
	body using inches. (Note: You could also do this by typing units in at the
	Command Window prompt.)
      </para>
    </section>
    
    <section xml:id="mug_outside_cyl"><info><title>Creating the Outside Cylinder Using the In Command</title></info>
      
      <para>
	To begin making the body, you will need to create an outside right
	circular cylinder. At the <application>MGED</application> prompt, type:
	
	<command>in bodyout.s rcc</command>
      </para>
      
      <para>
	The diagram of this command is as follows:
      </para>
      <informaltable>
	<tgroup cols="3">
	  <tbody>
	    <row>
	      <entry>in</entry>
	      <entry>bodyout.s</entry>
	      <entry>rcc</entry>
	    </row>
	    <row>
	      <entry>Make a shape</entry>
	      <entry>Call it bodyout.s</entry>
	      <entry>The shape type is right circular cylinder</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
      
      <para>
	<application>MGED</application> will ask you the following questions about the cylinder you want to
	make. Type in the values given in bold. Make sure you leave spaces between
	variable values.
	
	<command>Enter X, Y, Z of vertex: 0 0 0[Enter]</command>
	
	<command>Enter X, Y, Z of height (H) vector: 0 0 3.5[Enter]</command>
	
	<command>Enter radius: 1.75[Enter]</command>
      </para>
      
      <para>
	Note that the streamlined way to do this would be to type:
	
	<command>in bodyout.s rcc 0 0 0 0 0 3.5 1.75[Enter]</command>
      </para>
      
      <para>
	The diagram of this command is as follows:
      </para>
      <informaltable>
	<tgroup cols="6">
	  <tbody>
	    <row>
	      <entry>in</entry>
	      <entry>bodyout.s</entry>
	      <entry>rcc</entry>
	      <entry>0 0 0</entry>
	      <entry>0 0 3.5</entry>
	      <entry>1.75</entry>
	    </row>
	    <row>
	      <entry>Make a shape</entry>
	      <entry>Call it bodyout.s</entry>
	      <entry>The shape type is right circular cylinder</entry>
	      <entry>The x, y, and z of vertex is 0 0 0</entry>
	      <entry>The x, y, and z of the height vector is 0 0 3.5</entry>
	      <entry>The radius is 1.75</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
      <para>
	A shape of a cylinder, in wireframe form, will appear in the Graphics
	Window.
      </para>
    </section>

    <section xml:id="mug_inside_cyl"><info><title>Creating the Inside Cylinder</title></info>
      
      <para>
	Using this same method, type in the information for the inside right
	circular cylinder. This cylinder will be used to hollow out the outside
	cylinder. Whenever you are creating a hole in the surface of an object,
	make sure the shape creating the hole protrudes through the surface. This
	will ensure that you don't inadvertently leave a thin film of material
	where the two surfaces meet.
	
	<command>in bodyin.s rcc 0 0 0.25 0 0 3.5 1.5[Enter]</command>
      </para>
      
      <para>
	The diagram of this command is:
      </para>
      <informaltable>
	<tgroup cols="6">
	  <tbody>
	    <row>
	      <entry>in</entry>
	      <entry>bodyin.s</entry>
	      <entry>rcc</entry>
	      <entry>0 0 0.25</entry>
	      <entry>0 0 3.5</entry>
	      <entry>1.5</entry>
	    </row>
	    <row>
	      <entry>Make a shape</entry>
	      <entry>Call it bodyin.s</entry>
	      <entry>The shape type is right circular cylinder</entry>
	      <entry>The x, y, and z of vertex is 0, 0, and 0.25</entry>
	      <entry>The x, y, and z of the height vector is 0, 0, and 3.5</entry>
	      <entry>The radius is 1.5</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
      <para>
	A second cylinder, inside the first cylinder, should now appear in the
	Graphics Window.
      </para>
    </section>
    
    <section xml:id="mug_handle"><info><title>Creating the Handle</title></info>
      
      <para>
	Now you will want to enter some information about the body's handle. The
	shape type for the handle is an elliptical torus. At the Command Window
	prompt, type:
	
	<command>in handle.s eto 0 2.5 1.75 1 0 0[Enter]</command>
      </para>
      
      <para>
	The diagram of this command is:
      </para>
      <informaltable>
	<tgroup cols="5">
	  <tbody>
	    <row>
	      <entry>in</entry>
	      <entry>handle.s</entry>
	      <entry>eto</entry>
	      <entry>0 2.5 1.75</entry>
	      <entry>1 0 0</entry>
	    </row>
	    <row>
	      <entry>Make a shape</entry>
	      <entry>Name it handle.s</entry>
	      <entry>The shape type is elliptical torus</entry>
	      <entry>The x, y, and z of the vertex is 0, 2.5, and 1.75</entry>
	      <entry>The x, y, and z of the normal vector is 1, 0, and 0</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
      
      <para>
	The program will ask you to enter more values for the elliptical torus you
	are creating. Type in the values shown in bold.
	
	<command>Enter X, Y, Z, of vector C: .6 0 0[Enter]</command>
	
	<command>Enter radius of revolution, r: 1.45[Enter]</command>
	
	<command>Enter elliptical semi-minor axis, d: 0.2[Enter]</command>
      </para>
      
      <para>
	A doughnut shape should appear on the right-hand side of the body. If you
	look carefully, you can see that about one-third of the elliptical torus
	intersects the body.
      </para>
    </section>
    
    <section xml:id="mug_comb1"><info><title>Creating the Bodyout.s-Bodyin.s Combination</title></info>
      
      <para>
	The next step is to combine the two cylinders into the body of the mug. To
	do this, type:
	
	<command>comb body.c u bodyout.s - bodyin.s[Enter]</command>
      </para>
      
      <para>
	You have told the program to make the combination body.c out of the union
	of bodyout.s minus bodyin.s.
      </para>
      <informaltable>
	<tgroup cols="6">
	  <tbody>
	    <row>
	      <entry>comb</entry>
	      <entry>body.c</entry>
	      <entry>u</entry>
	      <entry>bodyout.s</entry>
	      <entry>-</entry>
	      <entry>bodyin.s</entry>
	    </row>
	    <row>
	      <entry>Make a combination</entry>
	      <entry>Call it body.c</entry>
	      <entry>Create a union of</entry>
	      <entry>bodyout.s cylinder</entry>
	      <entry>and subtract</entry>
	      <entry>bodyin.s cylinder</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
      
    </section>
    
    <section xml:id="mug_comb2"><info><title>Creating the Handle.s - Bodyout.s Combination</title></info>
      
      <para>
	To combine the handle with the outside cylinder, type:
	
	<command>comb handle.c u handle.s - bodyout.s[Enter]</command>
      </para>
      <informaltable>
	<tgroup cols="6">
	  <tbody>
	    <row>
	      <entry>comb</entry>
	      <entry>handle.c</entry>
	      <entry>u</entry>
	      <entry>handle.s</entry>
	      <entry>-</entry>
	      <entry>bodyout.s</entry>
	    </row>
	    <row>
	      <entry>Make a combination</entry>
	      <entry>Call it handle.c</entry>
	      <entry>Create a union of</entry>
	      <entry>the handle.s torus</entry>
	      <entry>and subtract</entry>
	      <entry>the bodyout.s cylinder</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </section>
    
    <section xml:id="mug_region"><info><title>Creating the Region Mug.r</title></info>
      
      
      <para>
	The last step, of this part of making the mug is to make a region out of
	your combinations. Type:
	
	<command>r mug.r u body.c u handle.c[Enter]</command>
      </para>
      <informaltable>
	<tgroup cols="6">
	  <tbody>
	    <row>
	      <entry>r</entry>
	      <entry>mug.r</entry>
	      <entry>u</entry>
	      <entry>body.c</entry>
	      <entry>u</entry>
	      <entry>handle.c</entry>
	    </row>
	    <row>
	      <entry>Make a region of shapes of the same material and color</entry>
	      <entry>Call it mug.r</entry>
	      <entry>Create a union of</entry>
	      <entry>the body.c combination</entry>
	      <entry>and merge it with</entry>
	      <entry>the handle.c combination</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
      
      <para>
	If you did this correctly, the program should say something similar to:
      </para>
      
      <literallayout class="normal">
   Defaulting item number to 1002

   Creating region id=1001, air=0, GIFTmaterial=1, los=100
      </literallayout>

      <informalfigure>
	<mediaobject>
	  <imageobject>
	    <imagedata align="center" fileref="../../lessons/en/images/mged10_mug_wireframe.png" format="PNG"/>
	  </imageobject>
	  <caption>
	    <para>
	     Wireframe Mug
	    </para>
	  </caption>
	</mediaobject>
      </informalfigure>

      <para>
	You should now have the region mug.r that is a combination of shapes
	containing the same material and color. You could assign color and
	material at this point, but you will want to do some more work on this
	design to make it more realistic. So, for now, review the lessons of this
	chapter. When you are ready to work again, you can continue refining your
	design in the next lesson.
      </para>
      
    </section>
    
    <section xml:id="mug_review"><info><title>Review</title></info>
      
      <para>
	In this lesson you:
	<itemizedlist mark="bullet">
	  <listitem>
	    <para>Created an outside cylinder using the in command.</para>
	  </listitem>
	  <listitem>
	    <para>Created an inside cylinder for hollowing out the larger shape cylinder.</para>
	  </listitem>
	  <listitem>
	    <para>Created a handle for your mug.</para>
	  </listitem>
	  <listitem>
	    <para>Created a combination to produce the body of your mug.</para>
	  </listitem>
	  <listitem>
	    <para>Created a combination to join the handle to the body.</para>
	  </listitem>
	  <listitem>
	    <para>Created a region of combined shapes with the same material and color.</para>
	  </listitem>
	</itemizedlist>
      </para>
    </section>

  </article>
