[MOAB-dev] ReadCGM question

Jason Kraftcheck kraftche at cae.wisc.edu
Wed Nov 3 15:51:20 CDT 2010


On 11/03/2010 03:43 PM, Steve Jackson wrote:
> In MOAB's ReadCGM.cpp, around line 490, there is the following check:
> 
> 
> // edge is a CGM RefEdge
> // start_vtx and end_vtx are RefVertices representing the start_vertex() and end_vertex() of edge
> // points is a list of CubitVectors produced by calling get_graphics() on edge
> 
>       // check proximity of vertices to end coordinates
>     if ((start_vtx->coordinates() - points.front()).length() > GEOMETRY_RESABS
>      || (  end_vtx->coordinates() - points.back() ).length() > GEOMETRY_RESABS ) {
>       std::cerr << "Warning: vertices not at ends of curve " << edge->id() << std::endl;
>     }
> 
> This warning often produces large quantities of annoying messages.  (I
> have one geometry where it produces tens of thousands of lines of output
> when the file is loaded into MOAB.)  I want to fix this, but first wanted
> to check with others on the most correct fix.
> 
> * If this check is correct (i.e. users should be legitimately concerned
> by it), I propose to make the warning message print only up to ten times,
> with a summary of the number of suppressed warnings if more than that
> occur.
> 

One message stating that the condition exists for one or more edges would
probably be sufficient.  If you chose to print multiple messages (e.g. 10)
then you should also print something stating that additional messages are
suppressed such that you don't give the user the impression that the
condition existed for only 10 edges.

An alternate solution is to build a list of all such edges and print a count
and/or a list of edge ids with a single error message outside of the loop.

> * I think it would it be more correct to replace GEOMETRY_RESABS with
> faceting_tol, i.e. the tolerance value that was used in calling
> edge->get_graphics().  Does anyone disagree?

I disagree.  This error indicates that the coordinates of the RefVertex are
not on the geometric curve, which it should be (or at least no further than
GEOMETRY_RESABS from the curve), regardless of the faceting.

- jason



More information about the moab-dev mailing list