Help save net neutrality! Learn more.
Close

combining a region with a primary and...

Help
2006-01-22
2013-04-22
  • Nobody/Anonymous

    Two questions for you, and thank you in advance.

    1.  When I combine a region with a primary through any boolean operation, it will make the new region as I ask, however, it gives an error stating that there are now two regions and one will take precendence over the other.  Should I be making a new region by removing the old one and combining all the primaries from scratch again?  Is it "legal" to combine a region and a primary?

    2.  After raytracing a region with assigned material properties, if I want to go back and edit the shapes in one way or another, the window looks like it got messed up.  If I do an fbclear in the GUI raytrace window, the traced portion dissapears but the outlines of the shapes don't appear correctly, parts of them don't appear at all.  Not sure why?

    Thanks again 

     
    • Nobody/Anonymous

      #2 could be the Z-clipping that is active.

      /Lars

       
    • DanB

      DanB - 2006-01-24

      Lars,
      Thanks for the tip, Z-clipping was active, once deactivated it took care of the problem I was seeing.  What is Z-clipping's purpose?  I'm still learning BRL-CAD so forgive me if this is covered in the tutorial, I haven't gotten through the whole thing yet.
      Thanks
      Dan

       
      • Sean Morrison

        Sean Morrison - 2008-05-23

        The purpose of Z-clipping is to not show objects outside the viewing cube.  There is an "eye" point in the scene and z-clipping doesn't show you what is actually behind your view plane.  With an orthogonal view in particular, though, you get to see the wireframe so most users expect to see everything regardless of the view plane (because they don't usually care about they eye point).  Even if the wireframe is clipped, most users still seem to expect it.  It should probably be off-by-default instead of on.

        Cheers!
        Sean

         
    • Nobody/Anonymous

      The purpose of Z-clipping is to make it easier to view details in a big construction. When Z-clipping is activated, you see what is inside a "viewing cube" and not the lines and wireframes positioned far behind it.

      /Lars

       
    • David Loman

      David Loman - 2008-05-27

      I am going to break your first question down:

      1a. When I combine a region with a primary through any Boolean operation, it will make the new region as I ask, however, it gives an error stating that there are now two regions and one will take precedence over the other.
      A 'region' defines an object by use of combining primitives together via Boolean operations, assignment of a Region ID (which may or may not be unique) and assignment of a MaterialID.  The last point is really the important one.  Assigning a MaterialID truly defines "what" the region defines.

      Take this example:
      outside.r is 'something' made out of Aluminum 2024 and inside.r is 'something' made out of Mild Steel. Thus, this makes sense:

      ****************
      mged> tree outside.r inside.r
      outside.r/R
          u outside01.s
          u outside02.s
          u outside03.s
          u outside04.s

      inside.r/R
          u inside01.s
          u inside02.s
          u inside03.s
          u inside04.s

      mged> attr show outside.r
      outside.r region:
          region        R
          region_id    5000
          material_id    5
          los        100

      mged> attr show inside.r
      inside.r region:
          region        R
          region_id    5100
          material_id    1
          los        100

      mged> 
      ****************

      Now, what it sounds like you have done is this:

      ****************
      mged> g outside.r inside.r
      mged> tree outside.r
      outside.r/R
          u outside01.s
          u outside02.s
          u outside03.s
          u outside04.s
          u inside.r/R
              u inside01.s
              u inside02.s
              u inside03.s
              u inside04.s

      mged> 
      ****************

      So when BRL-CAD looks at inside.r, it cannot tell if it is supposed to be Aluminum or Mild Steel.  Actually, few tools in BRL-CAD actually *care* about 2+ regions in a hierarchy branch, which is why it’s a warning, not a hard error.  There are some things that will not work with 2+ regions in a hierarchy branch.  For example, any weight estimation or center of mass calculations will fail due to the ambiguity of Materials.

      A "Proper" way to group these regions together is like so:

      ****************
      mged> tree outside.r
      outside.r/R
          u outside01.s
          u outside02.s
          u outside03.s
          u outside04.s
          u inside.r/R
              u inside01.s
              u inside02.s
              u inside03.s
              u inside04.s

      mged> rm outside.r inside.r
      deleted outside.r/inside.r

      mged> tree outside.r
      outside.r/R
          u outside01.s
          u outside02.s
          u outside03.s
          u outside04.s

      mged>
      mged>
      mged> g my_combination outside.r inside.r
      mged> tree my_combination
      my_combination/
          u outside.r/R
              u outside01.s
              u outside02.s
              u outside03.s
              u outside04.s
          u inside.r/R
              u inside01.s
              u inside02.s
              u inside03.s
              u inside04.s

      mged> 
      ****************

      1b. Should I be making a new region by removing the old one and combining all the primaries from scratch again?

      Depends on what you want to do….
      If you are needing to simply group the regions together for organization's sake, see my example in 1a.  If you are needing to perform intersection or subtraction, then utilize combinations below the region level:

      ****************
      mged> #look at my current hierarchy:
      mged> tree my_combination
      my_combination/
          u outside.r/R
              u outside01.s
              u outside02.s
              u outside03.s
              u outside04.s
          u inside.r/R
              u inside01.s
              u inside02.s
              u inside03.s
              u inside04.s

      mged>
      mged> #add in the combination between the solids and region:
      mged> rm outside.r outside0?.s
      deleted outside.r/outside01.s
      deleted outside.r/outside02.s
      deleted outside.r/outside03.s
      deleted outside.r/outside04.s

      mged> g outside.c outside0[1-4].s
      mged> g outside.r outside.c
      mged> #look at my hierarchy:
      mged> tree my_combination
      my_combination/
          u outside.r/R
              u outside.c/
                  u outside01.s
                  u outside02.s
                  u outside03.s
                  u outside04.s
          u inside.r/R
              u inside01.s
              u inside02.s
              u inside03.s
              u inside04.s

      mged> #Now do the same to 'inside':
      mged>  rm inside.r inside0?.s
      deleted inside.r/inside01.s
      deleted inside.r/inside02.s
      deleted inside.r/inside03.s
      deleted inside.r/inside04.s

      mged> #look at my hierarchy:
      mged> tree my_combination
      my_combination/
          u outside.r/R
              u outside.c/
                  u outside01.s
                  u outside02.s
                  u outside03.s
                  u outside04.s
          u inside.r/R

      mged> g inside.c inside0[1-4].s
      mged> g inside.r inside.c
      mged>  #look at my hierarchy:
      mged>  tree my_combination
      my_combination/
          u outside.r/R
              u outside.c/
                  u outside01.s
                  u outside02.s
                  u outside03.s
                  u outside04.s
          u inside.r/R
              u inside.c/
                  u inside01.s
                  u inside02.s
                  u inside03.s
                  u inside04.s

      mged> #now perform Boolean operations using the 'lower' combinations:
      mged> r outside.r - inside.c
      mged> #look at my hierarchy:
      mged> tree my_combination
      my_combination/
          u outside.r/R
              u outside.c/
                  u outside01.s
                  u outside02.s
                  u outside03.s
                  u outside04.s
              - inside.c/
                  u inside01.s
                  u inside02.s
                  u inside03.s
                  u inside04.s
          u inside.r/R
              u inside.c/
                  u inside01.s
                  u inside02.s
                  u inside03.s
                  u inside04.s

      mged> 
      ****************

      Just be careful  using this method as it can easily make a region unreadable and very slow to raytrace.  Primitives other than a BoT can still perform quickly in this kind of hierarchy.  BoTs, however, can drag BRL-CAD to its knees, performance wise, by performing too many Boolean operations (other than union) on them.

      1c.  Is it "legal" to combine a region and a primary?

      Depends on what the end use for the geometry is.  If it is going to be used in any form of analysis, then I would say no, its not legal.  If you are just describing geometry for the halibut, then do what ever you want!  In general, however, it is considered bad practice ;)

       
    • David Loman

      David Loman - 2008-05-27

      Ack, I completely forgot that the SF forums elminates tabs and other extra whitespace.  If my examples above don't make sence, I will use a wiki page and link to it from here.

      -Dave L

       

Log in to post a comment.