|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)|
On Fri, 15 Jan 2016 19:44:29 GMT, Anthony Villano wrote:
> I'm using Geant4.9.5.p01 to compile some geometry. I am upgrading to a > more recent version of Geant4 currently, so that's the reason for using > this older version for some geometrical constructions being done in > parallel. > > I am having trouble with G4SubtractionSolid, and I have to confess that > I have never been able to get complex geometry with this tool as it > seems that I should be able to.[...]
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2016/01/15/11.35-50773-g4codesnip.txt > > When I use the code above I can get the following geometry, where I made > the ridges go all the way through: > > http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2016/01/15/11.35-24414-plate.png > > However when I try to make it true to the mechanical drawing, i.e. the > ridges NOT going all the way through, I get the following error during > rendering of the geometry: > > Macro srcCloseup.mac is being run > libGL error: No matching fbConfigs or visuals found > libGL error: failed to load driver: swrast > G4Scene::AddWorldIfEmpty: The scene was empty of run-duration models. > "world" has been added.
This doesn't look like a problem with the booleans. With booleans, you get the world etc. created, but you'll get a complaint about "polyhedron not available" because the complex boolean couldn't be turned into tesselations. The above makes it look like your shell environment or installation is wrong.
> And the geometry does not render. Why does this occur? I am > daisy-chaining the creation of the G4SubtractionSolids in a way to make > the code more compact, is this reasonabe?
It's okay, but not necessary compact. Don't worry about memory leaks from the chained solids: they all go into the G4SolidStore and get deleted when you clear the geometry. However, you could create the underlying solids (the two parts for the countersink, and a single ridge) outside the loops, and then just keep re-subtracting them from the net piece.
Unfortunately, visualization has serious problems with complex booleans. That's been true for a long time, and continues to be true. Even something seemingly as simple as a cylindrical tube with a plate booleaned onto the end can fail to draw correctly :-(
If you are not concerned about optical physics with your object, there is another way. Make the simple rectangular plate (G4Box) as a "mother volume", and then do placements of the countersink holes and ridges as daughter volumes made of vacuum or air (or whatever the surrounding stuff is). Unless you have a situation where you want to place other stuff _into_ the ridges or countersinks, this method is more likely to render properly.
-- Mike Kelsey