Message: Re: Polyhedron::SetReferences: List N is not empty Not Logged In (login)

## Re: Polyhedron::SetReferences: List N is not empty

Forum: Geometry
Re: Polyhedron::SetReferences: List N is not empty (Nicola Mori)
Re: Re: Polyhedron::SetReferences: List N is not empty (John Allison)
Re: Re: Polyhedron::SetReferences: List N is not empty (Nicola Mori)
Date: 09 Apr, 2015
From: John Allison <John Allison>

 Dear Nicola Apologies for not getting back sooner, but I left for a few days away almost straight after posting the earlier response. In fact I'm still away but have found an internet connection. Ah! The polyhedron dump is interpreted as follows. The pairs are v/f pairs, shall we say v1/f1 v2/f2,... where v is the vertex number and f is the facet number of the facet adjacent that shares the edge defined by v1->v2. So... ```> face(1)= 1/2 2/4 3/5 0/0 > > face(2)= 1/3 4/6 2/1 0/0 > > face(3)= 5/7 6/6 4/2 1/5 > > face(4)= 7/7 8/5 3/1 2/6 > > face(5)= 8/7 5/3 1/1 3/4 > > face(6)= 6/7 7/4 2/2 4/3 > > face(7)= 5/5 8/4 7/6 6/3 > > The first 4 points are the 1,2,3 and 4 from the picture above bounding > the upper face of the cube, while the others are in the Z=0 layer. My > understanding of the dump of the facets is that facet 1 has an edge > going from point 1 to point 2 (correct), another edge going from point 2 > to point 4 (correct start but wrong end) and another edge going from > point 3 to point 5 (???). ``` Yes! From the above, facet 1 is 1->2->3 (ignore zeros). The first edge is 1->2 and the adjacent facet is facet 3. Facet 2 is 1->4->2 (correct); facet 3 is 5->6->4->1, etc. It's a laborious job checking through all this and I have not checked everything but it looks OK to me. Perhaps this should be documented but sometimes the only way is t look at the code. I take my interpretation from HepPolyhedron.cc - see below. John ```std::ostream & operator<<(std::ostream & ostr, const G4Facet & facet) { for (G4int k=0; k<4; k++) { ostr << " " << facet.edge[k].v << "/" << facet.edge[k].f; } return ostr; }``` ```std::ostream & operator<<(std::ostream & ostr, const HepPolyhedron & ph) { ostr << std::endl; ostr << "Nvertices=" << ph.nvert << ", Nfacets=" << ph.nface << std::endl; G4int i; for (i=1; i<=ph.nvert; i++) { ostr << "xyz(" << i << ")=" << ph.pV[i].x() << ' ' << ph.pV[i].y() << ' ' << ph.pV[i].z() << std::endl; } for (i=1; i<=ph.nface; i++) { ostr << "face(" << i << ")=" << ph.pF[i] << std::endl; } return ostr; } ```

1 Re: Polyhedron::SetReferences: List N is not empty   (Nicola Mori - 09 Apr, 2015)
 to: "Re: Polyhedron::SetReferences: List N is not empty"
This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]