full (not periodic) mirroring is geom_mirror default behavior
This commit is contained in:
parent
d79f0c6290
commit
cdc8338347
|
@ -23,27 +23,29 @@ Mirror along given directions.
|
||||||
|
|
||||||
""", version=scriptID)
|
""", version=scriptID)
|
||||||
|
|
||||||
|
validDirections = ['x','y','z']
|
||||||
|
|
||||||
parser.add_option('-d','--direction',
|
parser.add_option('-d','--direction',
|
||||||
dest = 'directions',
|
dest = 'directions',
|
||||||
action = 'extend', metavar = '<string LIST>',
|
action = 'extend', metavar = '<string LIST>',
|
||||||
help = "directions in which to mirror {'x','y','z'}")
|
help = "directions in which to mirror {{{}}}".format(','.join(validDirections)))
|
||||||
parser.add_option( '--double',
|
parser.add_option( '--periodic',
|
||||||
dest = 'double',
|
dest = 'periodic',
|
||||||
action = 'store_true',
|
action = 'store_true',
|
||||||
help = 'double the outer layers in mirror direction')
|
help = 'omit periodic copies of outermost layers in mirror direction')
|
||||||
|
|
||||||
|
parser.set_defaults(periodic = False)
|
||||||
|
|
||||||
(options, filenames) = parser.parse_args()
|
(options, filenames) = parser.parse_args()
|
||||||
|
|
||||||
if options.directions is None:
|
if options.directions is None:
|
||||||
parser.error('no direction given.')
|
parser.error('no direction given.')
|
||||||
|
|
||||||
validDirections = ['x','y','z']
|
|
||||||
if not set(options.directions).issubset(validDirections):
|
if not set(options.directions).issubset(validDirections):
|
||||||
invalidDirections = [str(e) for e in set(options.directions).difference(validDirections)]
|
invalidDirections = [str(e) for e in set(options.directions).difference(validDirections)]
|
||||||
parser.error('invalid directions {}. '.format(*invalidDirections))
|
parser.error('invalid directions {}. '.format(*invalidDirections))
|
||||||
|
|
||||||
limits = [-2,0] if not options.double else [None,None]
|
limits = [-2,0] if options.periodic else [None,None]
|
||||||
|
|
||||||
|
|
||||||
if filenames == []: filenames = [None]
|
if filenames == []: filenames = [None]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue