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

<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="nmg_collapse">

<refmeta>
  <refentrytitle>NMG_COLLAPSE</refentrytitle>
  <manvolnum>nged</manvolnum>
  <refmiscinfo class="source">BRL-CAD</refmiscinfo>
  <refmiscinfo class="manual">BRL-CAD User Commands</refmiscinfo>
</refmeta>

<refnamediv xml:id="name">
  <refname>nmg_collapse</refname>
  <refpurpose>Simplifies an existing <emphasis>nmg_shape</emphasis> by a process of edge
	decimation.
   </refpurpose>
</refnamediv>

<!-- body begins here -->
<refsynopsisdiv xml:id="synopsis">
  <cmdsynopsis sepchar=" ">
    <command>nmg_collapse</command>    
       <arg choice="req" rep="norepeat"><replaceable>old_nmg_shape new_nmg_shape maximum_error_dist</replaceable></arg>
   	 <arg choice="opt" rep="norepeat"><replaceable>minimum_angle</replaceable></arg>
  </cmdsynopsis>
</refsynopsisdiv>

<refsection xml:id="description"><info><title>DESCRIPTION</title></info>
  
  <para>Simplifies an existing <emphasis>nmg_shape</emphasis> by a process of edge
	decimation. Each edge in the <emphasis>old_nmg_shape</emphasis> is considered; if it can be deleted
	without creating an error greater than the specified <emphasis>maximum_error_dist,</emphasis> then that
	edge is deleted. If a <emphasis>minimum_angle</emphasis> is specified (degrees), then the edge will not 	be deleted if it would create a triangle with an angle less than <emphasis>minimum_angle</emphasis>. The
	resulting shape is saved in <emphasis>new_nmg_shape</emphasis>. The <emphasis>old_nmg_shape</emphasis>	must have been triangulated previous to using the <command>nmg_collapse</command> command. The resulting 	shape consists of all triangular faces.
   </para>
</refsection>

<refsection xml:id="examples"><info><title>EXAMPLES</title></info>
  
  <para>The example shows the use of the <command>nmg_collapse</command> command to simplify an existing nmg 	shape by decimating its edges. The new nmg shape will be within a maximum error distribution and will 	not have any triangles with angles less than a given minimum.
   </para>
   <example><info><title>Create a new nmg shape by decimating the edges of an existing nmg shape.</title></info>
    
    <para>
      <prompt>mged&gt;</prompt><userinput>nmg_collapse nmg_old nmg_new 1.0 10.0</userinput>
    </para>
    <para>Decimates edges in <emphasis>nmg_old</emphasis> to produce an NMG with an error no greater than 1.0
	units. The process will not create any triangles with an angle less than 10°. The new
	NMG shape will be named <emphasis>nmg_new</emphasis>.
    </para>
  </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>
