diff --git a/postproc.py b/postproc.py index e3e87249a..666262eca 100755 --- a/postproc.py +++ b/postproc.py @@ -104,6 +104,8 @@ '[default: if --3d is True: "45,45", else: "0,0"]', 'roll' : 'camera roll angle [default: %default]', + 'parallel_projection' : + 'use parallel projection', 'fgcolor' : 'foreground color, that is the color of all text annotation labels' ' (axes, orientation axes, scalar bar labels) [default: %default]', @@ -244,6 +246,7 @@ def view_file(filename, filter_names, options, view=None): view(show=options.show, is_3d=options.is_3d, view=options.view, roll=options.roll, + parallel_projection=options.parallel_projection, fgcolor=options.fgcolor, bgcolor=options.bgcolor, layout=options.layout, scalar_mode=options.scalar_mode, @@ -335,6 +338,9 @@ def main(): group.add_option('--roll', type='float', metavar='angle', action='store', dest='roll', default=0.0, help=help['roll']) + group.add_option('--parallel-projection', metavar='parallel_projection', + action='store_true', dest='parallel_projection', + default=False, help=help['parallel_projection']) group.add_option('--fgcolor', metavar='R,G,B', action='store', dest='fgcolor', default='0.0,0.0,0.0', help=help['fgcolor']) diff --git a/sfepy/postprocess/viewer.py b/sfepy/postprocess/viewer.py index 514ffb25d..b08e6accf 100644 --- a/sfepy/postprocess/viewer.py +++ b/sfepy/postprocess/viewer.py @@ -673,6 +673,7 @@ def render_scene(self, scene, options): self.build_mlab_pipeline(**options) self.source.update() # Force source update to see e.g. streamlines. scene.scene.reset_zoom() + scene.scene.camera.parallel_projection = options['parallel_projection'] view = options['view'] if view is None: @@ -718,7 +719,7 @@ def call_empty(self, *args, **kwargs): pass def call_mlab(self, scene=None, show=True, is_3d=False, - view=None, roll=None, + view=None, roll=None, parallel_projection=False, fgcolor=(0.0, 0.0, 0.0), bgcolor=(1.0, 1.0, 1.0), layout='rowcol', scalar_mode='iso_surface', vector_mode='arrows_norm', rel_scaling=None, clamping=False, @@ -745,6 +746,8 @@ def call_mlab(self, scene=None, show=True, is_3d=False, `mlab.view()`. roll : float Roll angle tuple as in mlab.roll(). + parallel_projection: bool + If True, use parallel projection. fgcolor : tuple of floats (R, G, B) The foreground color, that is the color of all text annotation labels (axes, orientation axes, scalar bar