|Message: Re: using G4SubtractionSolid correctly for complex geometry||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)|
Hi Mike and Anthony
You're right! The pointer reuse should not be a problem. I suspend judgement on the effect of a name reuse.
I think my initial response was a little hasty. In principle there should be nothing wrong in making a multiple subtraction. However, as Mike says, a mother-daughter would work better, more efficiently.
Let me make some further comments...
It's asking a lot of Geant4 to make a subtraction of subtractions 15 times. I imagine the vis representation would die - but let me say the tracking should be OK, but less efficient than a mother-daughter geometry.
However, if the vis system dies, it usually throws an error of the type "polyhedron not available" (as Mike said). I have never seen a vis problem of the type you describe, Anthony. (Again, to emphasise, the tracking should be OK - this is purely a vis problem. To check this you could use RayTracer - it uses the tracking system and is immune to these polyhedron vis problems.)
If you adopt a mother-daughter model be aware that a surface representation (and RayTracer) will disguise the daughters. A wireframe representation should show them.
If you stick to a subtraction-of-subtractions model, make sure the subtracting volume does not share surfaces. I would make it stick out slightly (this does not affect the subtraction result). For example, I would
const G4double extra = 1.*um;
and add it to to the (half) dimensions of the subtracting solid and make appropriate adjustments to shift.
Incidentally, it is enough to say
(the default is (0,0,0)).
And... it is not necessary to cast the pointer to G4SubtractionSolid:
botPlate = (G4VSolid*) new G4SubtractionSolid("botPlate_S",botPlate,small_hole,NULL,shift);
because a G4SubtractionSolid _is_ a G4VSolid and C++ allows
botPlate = new G4SubtractionSolid("botPlate_S",botPlate,small_hole,NULL,shift);
Finally, one possibility is to use a CAD system to define your plate and export it to Geant4. You will need to export it to a CAD system that can export to GDML (Geometry Definition Markup Language) and read it into Geant4 (see examples/extended/persistency/gdml). Get back to me about that.
|Inline Depth:||Outline Depth:||Add message:|