next up previous contents
Next: Region Codes and Titles Up: Overview Previous: Function and Design   Contents

Picking in Multiple Regions

It is possible to ask the geometry to pick in multiple regions, and this can be very useful if the boundary between them is artificial. For example, there is D$_2$O in both the D2O and the ACRC_IVL (acrylic chimney inner volume) regions, so to pick points in the D$_2$O requires picking points in both regions. When asked to pick a point in multiple regions, the geometry first picks a point weighting according to the volumes of the regions concerned. This ensures that larger volumes get picked more often. Along with the list of regions, the caller also supplies a list of weights, so can make some regions more ``active'' than others.

Although weighting by volume is self evident there are a couple of subtleties that need to be discussed. The first involves embedded regions. These, of course, reduce the volume of the region in which they embed. This can make the volume calculation difficult to do algebraically, and the situation gets worse if the embedding region can be switched off! To simplify this, the volume of each region is defined to be the total volume enclosed by its external boundary, i.e. ignoring any internal region. This does not lead to excess picking, due to an overestimate of the volume, because of the way picking takes place:-

  1. Pick a region according volume * user weight.

  2. Pick point in region's external boundaries.

  3. Veto point if within region's internal boundaries.

  4. If point vetoed, go back to step 1.

So, if a region has another embedded within it, it will be picked too often but that is exactly cancelled by the number of times it is vetoed due to the embedded region.

Sadly, there is a little complication to the simple picture. There are occasions when the scheme outlined above would be just plain dumb. For example, picking points in the acrylic vessel would be very slow if the point was picked in a sphere and then vetoed if within the D$_2$O . So, on occasions, the code is pragmatic, taking into account the internal region when picking. To ensure consistency, this means then the volume has to be adjusted to account for the embedded region. However, this is never done if the embedded region is switchable, so it is never necessary to adjust the volumes.

A second subtlety arises when dealing with `arrays' of regions, for example, the panel zones (regions that roughly surround each panel). For a region that is an array, the volume is that of the entire array, not a single element, so as to make it easy to pick in multiple regions including arrays. If the picked point is in the array region, the geometry picks an individual member according to its volume relative to the entire array. The caller can easily pick points in a specific member for, in this case, the volume weighting is irrelevant. However, the caller has to do some work if wanting to pick points in a selection of member regions unless they all have the same volume, and must include the relative volumes as part of the user supplied weights for each region.


next up previous contents
Next: Region Codes and Titles Up: Overview Previous: Function and Design   Contents
sno Guest Acct 2009-09-09