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

<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="bot_decimate">
  <refmeta>
    <refentrytitle>BOT_DECIMATE</refentrytitle>
    <manvolnum>nged</manvolnum>
    <refmiscinfo class="source">BRL-CAD</refmiscinfo>
    <refmiscinfo class="manual">BRL-CAD User Commands</refmiscinfo>
  </refmeta>
  
  <refnamediv xml:id="name">
    <refname>bot_decimate</refname>
    <refpurpose>
      Reduces the number of triangles in the
      <emphasis>old_bot_primitive</emphasis> and saves the results to the 
      <emphasis>new_bot_primitive</emphasis>.
    </refpurpose>
  </refnamediv>
  
  <!-- body begins here -->
  <refsynopsisdiv xml:id="synopsis">
    <cmdsynopsis sepchar=" ">
      <command>bot_decimate</command>    
      <arg choice="opt" rep="norepeat">-c <replaceable>maximum_chord_error</replaceable></arg>
      <arg choice="opt" rep="norepeat">-n <replaceable>maximum_normal_error</replaceable></arg>
      <arg choice="opt" rep="norepeat">-e <replaceable>minimum_edge_length</replaceable></arg>
      <arg choice="req" rep="norepeat"> <replaceable>new_bot_primitive</replaceable></arg>
      <arg choice="req" rep="norepeat"> <replaceable>old_bot_primitive</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  
  <refsection xml:id="description"><info><title>DESCRIPTION</title></info>
    
    <para> Reduces the number of triangles in the <emphasis>old_bot_primitive</emphasis> 
    and saves the results to the <emphasis>new_bot_primitive</emphasis>.
    The reduction is accomplished through an edge decimation algorithm. Only changes that do not
    violate the specified constraints are performed. The <emphasis>maximum_chord_error</emphasis>
    parameter specifies the maximum distance allowed between the original surface and
    the surface of the new BOT primitive in the current editing units. The
    <emphasis>maximum_normal_error</emphasis> specifies the maximum change in surface normal (degrees)
    between the old and new surfaces. The <emphasis> minimum_edge_length</emphasis> specifies 
    the length of the longest edge that will be decimated. At least one constraint must be 
    supplied. If more than one constraint is specified, then only operations that satisfy all 
    the constraints are performed.
    </para>
  </refsection>
  
  <refsection xml:id="examples"><info><title>EXAMPLES</title></info>
    
    <para>
      These examples demonstrate the use of the <command>bot_decimate</command> command to 
      create new primitives by reducing the number of triangles within certain constraints. 
    </para>
    <example><info><title>Decimate Specifying Chord Error and Max Normal Error</title></info>
      
      <para>
	Creating a new BOT primitive by reducing the number of triangles in the old BOT primitive 
	and specifying the maximum chord error and maximum normal error between the old and new 
	primitives.
      </para>
      <variablelist>
	<varlistentry>
	  <term><prompt>mged&gt;</prompt> <userinput>bot_decimate -c 0.5 -n 10.0 bot.new abot</userinput></term>
	  <listitem>
	    <para>
	      Creates a new BOT primitive named <emphasis>bot.new</emphasis>by reducing the number 
	      of triangles in <emphasis>abot</emphasis> while keeping the resulting surface within 
	      0.5 units of the surface of <emphasis>abot</emphasis> and keeping the surface normals 
	      within 10 degrees.
	    </para>
	    <para>
	      Note that the constraints specified only relate the output BOT primitive to the input
	      BOT primitive for a single invocation of the command. Repeated application of this
	      command on its own BOT output will result in a final BOT primitive that has
	      unknown relationships to the original BOT primitive. For example: 
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><prompt>mged&gt;</prompt> <userinput>bot_decimate -c 10.0 bot_b bot_a</userinput></term>
	</varlistentry>
	<varlistentry>
	  <term><prompt>mged&gt;</prompt> <userinput>bot_decimate -c 10.0 bot_c bot_b</userinput></term>
	  <listitem>
	  <para/>
	    <para>
	      This sequence of commands will produce primitive <emphasis>bot_c</emphasis>with 
	      up to 20.0 units of chord error between <emphasis>bot_a</emphasis> and 
	      <emphasis>bot_c</emphasis>.
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><prompt>mged&gt;</prompt> <userinput>bot_decimate -c 10.0 bot_b bot_a</userinput></term>
	</varlistentry>
	<varlistentry>
	  <term><prompt>mged&gt;</prompt> <userinput>bot_decimate -n 5.0 bot_c bot_b</userinput></term>
	  <listitem>
	    <para/>
	    <para>This sequence of commands will produce primitive <emphasis>bot_c</emphasis> with 
	    no guaranteed relationships to <emphasis>bot_a</emphasis>. </para>
	  </listitem>
	</varlistentry>
      </variablelist>
    </example>
  </refsection>
  
  <info><corpauthor>BRL-CAD Team</corpauthor></info>
  
  <refsection xml:id="bug_reports"><info><title>BUG REPORTS</title></info>
    
    <para>
      Reports of bugs or problems should be submitted via electronic
      mail to &lt;devs@brlcad.org&gt;, or via the "cadbug.sh" script.
    </para>
  </refsection>
</refentry>
