|Message: Trouble with G4SubtractionSolid -- pipe at angle to wall||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
I am having trouble constructing a specific G4SubtractionSolid: a flat panel (scintillator veto) with a cylindrical hole drilled at an angle to the surface.
I have checked my geometry, and have convinced myself that I'm supplying the correct parameters, but the hole comes out perpendicular to the surface. Here is a simplified version of the code I'm using:
G4Box* panel = new G4Box("Panel", scintThick/2., sidePanelWidth/2., midPanelHeight/2.); G4Tubs* pipe = new G4Tubs("PipeHole", 0., radius, thick/2., 0, 360*deg);
G4double phi = -(panelTransform.getRotation().phiX());
G4RotationMatrix holerot; holerot.rotateY(90*deg).rotateZ(phi);
G4ThreeVector holepos(0., holeY, holeZ);
G4VSolid* panelWithHole = new G4SubtractionSolid("PanelWithHole", panel, pipe, &holerot, holepos);
The angle "phi" is where the panel ends up positioned in the pentagon. With "holerot", I first take the G4Tubs, and rotate it horizontally, then that horizontal position is rotated around Z "opposite" the panel's transform. The net result _should_ be the panel is at an angle, but the hole is along the X axis.
The attached graphic shows what I mean. The yellow panel is tilted at 36 degrees to the viewpoint (it's part of a pentagon, with the point toward the viewer). The hole you see _should_ be exactly along the viewpoint (X) axis, but instead you can see that it's also tilted. By playing with viewpointThetaPhi, I have confirmed that the hole is exactly normal to the panel, which it should not be.
This is not just a visualization issue. Grid_test confirms that the pipe which comes through the hole (which I suppressed for the drawing) has volume overlaps with the panel.
Am I just missing some simple piece of geometry? Or have I found a problem with boolean solids dealing with compound rotations? The fact that the hole appears circular at all means that the rotateY() operation above _is_ being applied; it's the subsequent rotateZ() which is not.
-- Michael Kelsey
|Inline Depth:||Outline Depth:||Add message:|