Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

gqa questions / overlap questions

Help
Brian
2012-09-12
2013-04-22
  • Brian
    Brian
    2012-09-12

    I'm testing a model for overlaps and using the gqa command…

    First, is this the best command for this application?
    Second, is there any documentation of this command?
    Third, can you output the results to a text file?  (I am trying to run a script checking multiple orientations)

     
  • Brian
    Brian
    2012-09-12

    I believe I have gotten a script to work and provide the out put I want, however I have noticed that the output says:

    azimuth not implemented
    elevation not implemented

    Is there a reason the azimuth and elevation are not working?

    I have tried both this:
    exec "$transPath/g_qa.exe" -Ao -a0 -e45 -t0.25mm -g7mm-7mm $filename all >>& $logfile
    and
    exec "$transPath/g_qa.exe" -Ao -a 0 -e 45 -t0.25mm -g7mm-7mm $filename all >>& $logfile

     
  • Sean Morrison
    Sean Morrison
    2012-09-12

    Hi Banaelis,

    First, yes or at least probably.  The "rtcheck" command is much simpler and easier to use, but limited in how it detects overlaps.
    Second, yes - man gqa (or brlman gqa if you've not set up your MANPATH).  Since it looks like you're on windows, you should be able to access the manual pages from within MGED.
    Third, absolutely, though that is outside the scope of gqa and has more to do with scripting.  Looks like you figured that part out.

    As for azimuth and elevation not working, it's because gqa doesn't support arbitrary views.  For most models, it doesn't need to either.  It uses a specific ray sampling approach to find overlaps…  It fires rays down the XY, YZ, and XZ planes (down the three principle axes) progressively increasing the grid density looking for overlaps.  You can check for non axis-aligned overlaps with specific azimuth and elevations using the rtcheck command.

    Note that in some places the command is called "gqa" and in others it's "g_qa".  The latter is deprecated.

    Cheers!
    Sean

     
  • Brian
    Brian
    2012-09-12

    "For most models, it doesn't need to either." - I must have some of those minorities, because I have noticed getting different results after rotating a model.  When in mged, I usually run the following views 3,4,T,L and will get slightly different results.

    "Note that in some places the command is called "gqa" and in others it's "g_qa". The latter is deprecated."  I have noticed that there were two.  however in the bin directory, I don't see a "gqa" only "g_qa".

    "man gqa" from mged  worked great!  thanks!

     
  • Sean Morrison
    Sean Morrison
    2012-09-12

    You'll certainly get "different" results, but they should be the same overlap pairings just with different thicknesses being reported.  The gqa command is effectively testing top, left, and front views - all simultaneously and in parallel.  The only blind spot will be overlaps along the diagonal (45,45) and even then, they can only be thin slivers of material (otherwise they'd be detected by one of the three axes being tested).

    Any other difference will simply be different grid densities.  When in mged, for example, rtcheck uses a default grid based on the current view size.  However, gqa does not use the view size.

    You won't see gqa in the bin directory until g_qa is removed - that's the nature of it having a deprecated status.  This allows users time to discover that the name is changing so (hopefully) they're not confused when the old name is finally removed.

    Cheers!
    Sean

     
  • Brian
    Brian
    2012-09-19

    Could you please explain how the grid works for gqa.  I checked a model with "gqa -Ao -t0.2mm -g7mm-7mm" many times and resolved all overlaps, then I ran it with "gqa -Ao -t0.2mm -g10mm-10mm" and found 8 overlaps, including one with a distance of 162.9mm. 

    1 - I'm thought that a tighter grid would provide a more accurate solution.
    2 - Do I have to check a variety of other grid sizes? i.e. 8mm? 15mm? 20mm? etc?

    Additionally… I ran a "gqa -Ao -t0.2mm -g8mm-8mm" and got 11 overlaps…. and the list doesn't have much overlap with the 10x10…   I could use some help understanding how to accurately get overlaps over a certain tolerance.

    The overlaps I'm finding are well above the tolerance.  Ranging from .4553mm to 162.9mm, but mostly in the 1-2mm range.

     
  • Sean Morrison
    Sean Morrison
    2012-09-20

    The manual page explains in more extensive detail (brlman gqa), but the basic reason you're finding different results is almost certainly due to differences in grid alignment.  You're specifying a fixed grid size with no refinement so the resulting thicknesses and overlaps being reported are going to vary significantly.  You can see the actual grid using the -p option and the 'plot' command in mged.

    Consider a simple 2D example of two boxes that overlap just slightly:

      ……………………………..
      |                                 |
      |                                 |
      |                                 |
      |                                 |
    ..|………………………….. |
    | |………………………….|.|   0.1 mm overlap
    |                                 |
    |                                 |
    |                                 |
    |                                 |
    |……………………………|    200x200 mm box

    The gqa tool is going to fire rays down the x (horizontal) and y (vertical) axes at the specified resolution.  Depending on the alignment of the rays, you'll easily miss the middle overlapping section with horizontal rays even with a very small grid spacing and then suddenly get a huge overlap with a different grid spacing as a ray cuts through the long overlapping section.  You may not even detect this overlap with the vertical rays if the section is paper thin and below your overlap tolerance.

    So what can you do?  Well, for starters you can refine your grid.

    You do generally have the right idea - that a more dense grid is going to be "more accurate".  The difference is that the grid spacing only bounds two of the three axes.  So you want a really fine grid to start with so you know that alignment issues are going to be insignificant.  Even if you change the spacing and get a huge overlap, you know it's a sliver of material with a cross-section no bigger than your grid spacing (e.g., a long thin rod or box).

    Most of our production users *require* 1mm grid spacing.  Personally, I'd go even further.

    What we really need is for gqa to report the *volume* of the overlapping sections, not the ray thicknesses, since that is really what you're trying to minimize.  Alas, that's not something presently being calculated.

    Cheers!
    Sean

     
  • Brian
    Brian
    2012-09-20

    Most of our production users *require* 1mm grid spacing. Personally, I'd go even further.

    ^ Incredibly helpful thank you.

    What we really need is for gqa to report the *volume* of the overlapping sections, not the ray thicknesses, since that is really what you're trying to minimize. Alas, that's not something presently being calculated.

    ^ Any plans to incorporate this in the future?

    Thank you

     
  • Sean Morrison
    Sean Morrison
    2012-09-20

    ^ Any plans to incorporate this in the future?

    Absolutely.  Anytime soon?  Probably not.

    It's a perfect task for a new contributor, though, so I'll keep it in mind when folks come around asking what they can do to get involved in BRL-CAD development.

    Cheers!
    Sean