Revision: 71789
          http://sourceforge.net/p/brlcad/code/71789
Author:   starseeker
Date:     2018-09-23 14:23:54 +0000 (Sun, 23 Sep 2018)
Log Message:
-----------
Add an MGED 'lint' command to find and report various problems in a .g 
database.  In the long run this might actually be a good place to put 
functionality like rtcheck and gqa's overlap testing, and it definitely needs 
more checks for things like twisted arbs and other invalid primitive 
definitions, but for the moment start with a few basic tests for cyclic paths, 
missing objects and invalid BoTs.

Modified Paths:
--------------
    brlcad/trunk/NEWS
    brlcad/trunk/doc/docbook/system/mann/CMakeLists.txt
    brlcad/trunk/doc/docbook/system/mann/facetize.xml

Added Paths:
-----------
    brlcad/trunk/doc/docbook/system/mann/lint.xml

Modified: brlcad/trunk/NEWS
===================================================================
--- brlcad/trunk/NEWS   2018-09-23 13:57:11 UTC (rev 71788)
+++ brlcad/trunk/NEWS   2018-09-23 14:23:54 UTC (rev 71789)
@@ -13,6 +13,7 @@
 --- 201X-XX-XX  Release 7.28.0                                     ---
 ----------------------------------------------------------------------
 
+* added an MGED 'lint' command for finding bad geometry - CLiff Yapp
 * improved lingering framebuffer CPU utilization  - Sean Morrison
 * updated 'draw -S' option to work with shaded objects - Bob Parker
 * fixed numerous fb* command bugs w/ X11 framebuffers - Sean Morrison

Modified: brlcad/trunk/doc/docbook/system/mann/CMakeLists.txt
===================================================================
--- brlcad/trunk/doc/docbook/system/mann/CMakeLists.txt 2018-09-23 13:57:11 UTC 
(rev 71788)
+++ brlcad/trunk/doc/docbook/system/mann/CMakeLists.txt 2018-09-23 14:23:54 UTC 
(rev 71789)
@@ -121,6 +121,7 @@
   l_muves.xml
   labelvert.xml
   lc.xml
+  lint.xml
   listeval.xml
   lm.xml
   loadtk.xml

Modified: brlcad/trunk/doc/docbook/system/mann/facetize.xml
===================================================================
--- brlcad/trunk/doc/docbook/system/mann/facetize.xml   2018-09-23 13:57:11 UTC 
(rev 71788)
+++ brlcad/trunk/doc/docbook/system/mann/facetize.xml   2018-09-23 14:23:54 UTC 
(rev 71789)
@@ -72,7 +72,7 @@
       progress on large conversion tasks.
     </para>
   </refsection>
-  
+
   <refsection xml:id="regions">
     <title>PER-REGION FACETIZATION AND PARTIAL CONVERSIONS</title>
     <para>
@@ -101,7 +101,7 @@
 
     <refsection xml:id="examples">
     <title>EXAMPLES</title>
-    
+
     <example>
       <title>Create a facetized BOT version of an existing object.</title>
       <para>
@@ -114,7 +114,7 @@
        <prompt>mged&gt;</prompt> <userinput>facetize region1.r 
region1.bot</userinput>
       </para>
     </example>
-    
+
     <example>
       <title>Facetize all regions in a hierarchy.</title>
       <para>
@@ -125,7 +125,7 @@
        <prompt>mged&gt;</prompt> <userinput>facetize -r model 
model.f</userinput>
       </para>
     </example>
-    
+
     <example>
       <title>Facetize all regions in a hierarchy, attempting only NMG 
conversion.</title>
       <para>
@@ -149,7 +149,7 @@
     </example>
 
   </refsection>
-  
+
   <refsection xml:id="methodology">
     <title>METHODOLOGY</title>
     <para>
@@ -214,7 +214,7 @@
       more fine grained controls when it comes to generating point sets from 
BRL-CAD objects.
     </para>
   </refsection>
-  
+
   <refsection xml:id="util">
     <title>USEFUL TRICKS</title>
     <para>
@@ -232,20 +232,19 @@
        <prompt>mged&gt;</prompt> <userinput>search -attr facetize:CM -exec 
attr rm "{}" facetize:CM ";"</userinput>
       </para>
     </example>
-    
+
     <example>
       <title>List invalid BoT objects below a comb</title>
       <para>
-       Use search -exec and a Tcl proc to report on invalid objects below a 
comb.
+       Use lint -M to report on invalid objects below a comb.
       </para>
       <para>
-       <prompt>mged&gt;</prompt> <userinput>proc echoinvalid {objname} { if 
{!\[bot check solid $objname\] } { puts $objname } }</userinput>
-       <prompt>mged&gt;</prompt> <userinput>search comb -type bot -exec 
echoinvalid "{}" ";"</userinput>
+       <prompt>mged&gt;</prompt> <userinput> lint -M model.f</userinput>
       </para>
     </example>
-    
+
   </refsection>
-  
+
   <refsection xml:id="author">
     <title>AUTHOR</title>
     <para>BRL-CAD Team</para>
@@ -259,5 +258,5 @@
       mail to &lt;d...@brlcad.org&gt;, or via the "cadbug.sh" script.
     </para>
   </refsection>
-  
+
 </refentry>

Added: brlcad/trunk/doc/docbook/system/mann/lint.xml
===================================================================
--- brlcad/trunk/doc/docbook/system/mann/lint.xml                               
(rev 0)
+++ brlcad/trunk/doc/docbook/system/mann/lint.xml       2018-09-23 14:23:54 UTC 
(rev 71789)
@@ -0,0 +1,139 @@
+<refentry xmlns="http://docbook.org/ns/docbook"; version="5.0" xml:id="lint">
+
+  <refmeta>
+    <refentrytitle>LINT</refentrytitle>
+    <manvolnum>nged</manvolnum>
+    <refmiscinfo class="source">BRL-CAD</refmiscinfo>
+    <refmiscinfo class="manual">BRL-CAD User Commands</refmiscinfo>
+  </refmeta>
+
+  <refnamediv xml:id="name">
+    <refname>lint</refname>
+    <refpurpose>Detect and report problems with subsets or all of a .g 
database.
+    </refpurpose>
+  </refnamediv>
+
+  <!-- body begins here -->
+  <refsynopsisdiv xml:id="synopsis">
+    <cmdsynopsis sepchar=" ">
+      <command>lint</command>
+      <arg choice="opt" rep="norepeat">-h</arg>
+      <arg choice="opt" rep="norepeat">-C</arg>
+      <arg choice="opt" rep="norepeat">-M</arg>
+      <arg choice="opt" rep="norepeat">-I</arg>
+      <arg choice="opt" 
rep="norepeat"><replaceable>ObjectName</replaceable></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsection xml:id="description"><title>DESCRIPTION</title>
+  <para>
+    The 'lint' command analyzes the currently open geometry database (or a 
subset of
+    that database if object names are supplied as arguments) and searches for 
a variety
+    of problems know to sometimes occur.  By default all defect types are 
searched for -
+    if one or more of the options enabling a search for a specific type of 
problem are
+    supplied, only those searches will be performed.
+  </para>
+  </refsection>
+
+  <refsection xml:id="options"><title>OPTIONS</title>
+  <variablelist remap="TP">
+    <varlistentry>
+      <term><option>-h</option></term>
+      <listitem>
+       <para>
+         Print help message.
+       </para>
+      </listitem>
+    </varlistentry>
+    <varlistentry>
+      <term><option>-C</option>, <option>--cyclic</option></term>
+      <listitem>
+       <para>
+         Check for full paths that are cyclic - i.e. a situation where a high
+         level object incorporates in its definition tree a reference to 
itself.
+         Such definitions are always considered invalid, and are sometimes 
problematic
+         for tools working with geometry hierarchy.
+       </para>
+      </listitem>
+    </varlistentry>
+    <varlistentry>
+      <term><option>-M</option>, <option>--missing</option></term>
+      <listitem>
+       <para>
+         Check for references to objects or files that are missing (not present
+         in the database or on the file system.)  Primarily this is a check for
+         comb objects referring to missing objects, but it will also check for
+         and report invalid object and file references in extrude
+         and dsp primitives.
+       </para>
+      </listitem>
+    </varlistentry>
+    <varlistentry>
+      <term><option>-I</option>, <option>--invalid</option></term>
+      <listitem>
+       <para>
+         Check for shapes in the database that do not satisfy one or more 
properties
+         required for them to be valid definitions, where correcting the 
problem requires
+         a change to the object's definition.  (As of this writing the only 
implemented
+         check is for BoT object solidity, but many more are possible and 
planned.)
+         (Objects invalid due to missing objects are potentially valid without 
the necessity
+         of changing the object's own definition - e.g. the missing 
object/file can be added.
+         That category of error can be searched for with the 
<option>-M</option> check.)
+       </para>
+      </listitem>
+    </varlistentry>
+
+  </variablelist>
+  </refsection>
+  
+  <refsection xml:id="examples"><title>EXAMPLES</title>
+
+  <example>
+    <title>Examine a single geometry object for validity</title>
+
+    <para>
+      <prompt>mged&gt; </prompt><userinput>lint -I nonsolid.bot</userinput>
+      <literallayout class="normal">
+Checking for invalid objects...
+Found invalid objects:
+  nonsolid.bot[bot] failed bot solid test
+
+      </literallayout>
+    </para>
+  </example>
+
+  <example>
+    <title>Examine entire database for all defect categories</title>
+
+    <para>
+      <prompt>mged&gt; </prompt><userinput>lint</userinput>
+      <literallayout class="normal">
+Checking for cyclic paths...
+Checking for references to non-extant objects...
+Checking for invalid objects...
+Found cyclic paths:
+  /c1/c2/c1
+  /c2/c1/c2
+Found references to missing objects:
+  invalid_dsp_missing_binary_obj.s/missing_binary_object.s
+  invalid_dsp_missing_file.s/missing_file.data
+  invalid_extrude_missing_sketch.s/missing_sketch.s
+  missingentry.c/missing.s
+Found invalid objects:
+  nonsolid.bot[bot] failed bot solid test
+
+      </literallayout>
+    </para>
+  </example>
+  </refsection>
+  
+  <refsection xml:id="author"><title>AUTHOR</title><para>BRL-CAD 
Team</para></refsection>
+
+  <refsection xml:id="bug_reports"><title>BUG REPORTS</title>
+
+  <para>
+    Reports of bugs or problems should be submitted via electronic
+    mail to &lt;d...@brlcad.org&gt;, or via the "cadbug.sh" script.
+  </para>
+  </refsection>
+</refentry>


Property changes on: brlcad/trunk/doc/docbook/system/mann/lint.xml
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to