RE: [ROOTTALK] Overlaping nodes

From: Valery Fine (Faine) (fine@bnl.gov)
Date: Fri May 21 1999 - 05:42:08 MEST


> Hi All,
> 
> Is it possible to use one node to "cut" a piece out of another one? In
> Geant it was possible to overwrite one region of space occupied by an
> object consisting of a certain material by another one consisting of
> another material (the "only" option). In that way it was possible to
> create complicated shapes by trimming the edges of simple shapes with
> pieces of air, which are then invisible. 

  It seems to me GEANT (I mean geant 3.21) never could do what you
  are speaking about.

> 
> What I am trying to do is to make a drawing of a light guide that is
> triangular on one side and circular on the other. The circular end is the
> narrow end of a cone; the other end of this cone just circumscribes the
> triangle. A TPGON unfortuately doesn't let you set the inner and outer
> radii for each point independently, otherwise it would be easy.

  With C++ it is quite easy. For that you should take that TPGON class 
  as a base one and create your own class derived from that

  Very likely you will have to provide only method to overload:

   void TPCON::SetPoints(Float_t *buff)

This method is a few lines of code and looks as follows:

void TPCON::SetPoints(Float_t *buff)
{
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Create PCON points*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                            ==================
 
    Int_t i, j;
    Int_t indx = 0;

    if (buff) { 
        Int_t n            = GetNumberOfDivisions()+1;

//*-* We've to check whether the table does exist and create it
//*-* since fCoTab/fSiTab are not saved with any TShape::Streamer function
        if (!fCoTab)   MakeTableOfCoSin();
 
        for (i = 0; i < fNz; i++)
        {
            for (j = 0; j < n; j++)
            {
                buff[indx++] = fRmin[i] * fCoTab[j];
                buff[indx++] = fRmin[i] * fSiTab[j];
                buff[indx++] = fDz[i];
            }
            for (j = 0; j < n; j++)
            {
                buff[indx++] = fRmax[i] * fCoTab[j];
                buff[indx++] = fRmax[i] * fSiTab[j];
                buff[indx++] = fDz[i];
            }
        }
    }

 I wonder any student  can provide his/her own version.


> 
> Anybody who knows how to solve this problem? Or is it simply not possible
> in Root since it is not an AutoCad clone? 

   It is simply possible because ROOT is C++ class library simply.
   No AutoCad will allow you to make some sort of improvement 
  "by simple-mind user" though.

   With my best regards,
                                  Valery

> 
> Thanks,
> 
> -- Gerco
> 
> Dr. C.J.G. Onderwater
> Nuclear Physics Laboratory
> 312 Loomis Laboratory of Physics
> University of Illinois at Urbana-Champaign
> 1110 West Green Street
> Urbana, IL 61801-3080     
> Phone : (217) 244-7363
> Fax   : (217) 333-1215  
> E-mail: onderwat@uiuc.edu
> 
> 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:33 MET