Mercurial > repos > iuc > icqsol_create_shape
changeset 0:fe94052daa00 draft default tip
Uploaded
author | iuc |
---|---|
date | Tue, 23 Aug 2016 15:00:22 -0400 |
parents | |
children | |
files | icqsol_create_shape.py icqsol_create_shape.xml icqsol_macros.xml icqsol_utils.py test-data/head.vtkascii test-data/notch1.vtkascii test-data/notch2.vtkascii test-data/shaft.vtkascii |
diffstat | 8 files changed, 727 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/icqsol_create_shape.py Tue Aug 23 15:00:22 2016 -0400 @@ -0,0 +1,85 @@ +#!/usr/bin/env python +import argparse +import shutil + +import icqsol_utils + +# Parse Command Line. +parser = argparse.ArgumentParser() +parser.add_argument('--create_process', dest='create_process', help='Shape creation process (create or clone)') +parser.add_argument('--shape_input', dest='shape_input', default=None, help='Shape file if create_process is clone') +parser.add_argument('--shape', dest='shape', default=None, help='Shape if create_process is create') +parser.add_argument('--origin_x', dest='origin_x', type=float, default=None, help='X coordinate of origin') +parser.add_argument('--origin_y', dest='origin_y', type=float, default=None, help='Y coordinate of origin') +parser.add_argument('--origin_z', dest='origin_z', type=float, default=None, help='Z coordinate of origin') +parser.add_argument('--length_x', dest='length_x', type=float, default=None, help='X coordinate of end') +parser.add_argument('--length_y', dest='length_y', type=float, default=None, help='Y coordinate of end') +parser.add_argument('--length_z', dest='length_z', type=float, default=None, help='Z coordinate of end') +parser.add_argument('--angle', dest='angle', type=float, default=None, help='Angle') +parser.add_argument('--radius', dest='radius', type=float, default=None, help='Radius') +parser.add_argument('--n_theta', dest='n_theta', type=int, default=0, help='Number of slices') +parser.add_argument('--n_phi', dest='n_phi', type=int, default=0, help='Number of stacks') +parser.add_argument('--rotate', dest='rotate', help='Rotate cloned shape') +parser.add_argument('--rotation_axis_x', dest='rotation_axis_x', type=float, default=None, help='X component of rotation axis') +parser.add_argument('--rotation_axis_y', dest='rotation_axis_y', type=float, default=None, help='Y component of rotation axis') +parser.add_argument('--rotation_axis_z', dest='rotation_axis_z', type=float, default=None, help='Z component of rotation axis') +parser.add_argument('--rotation_degree', dest='rotation_degree', type=float, default=None, help='Degree of rotation around axis') +parser.add_argument('--translate', dest='translate', help='Translate cloned shape') +parser.add_argument('--output', dest='output', default=None, help='Output dataset') +parser.add_argument('--output_vtk_type', dest='output_vtk_type', help='Output file format and type') + +args = parser.parse_args() + +if args.origin_x is not None and args.origin_y is not None and args.origin_z is not None: + origin = [args.origin_x, args.origin_y, args.origin_z] +if args.length_x is not None and args.length_y is not None and args.length_z is not None: + lengths = [args.length_x, args.length_y, args.length_z] +if args.rotation_axis_x is not None and args.rotation_axis_y is not None and args.rotation_axis_z is not None: + rotation_axis = [args.rotation_axis_x, args.rotation_axis_y, args.rotation_axis_z] + +# Define the output file format and type. +format, file_type = icqsol_utils.get_format_and_type(args.output_vtk_type) +tmp_dir = icqsol_utils.get_temp_dir() +cloning = True if args.create_process == 'clone' else False + +# TODO: fix this to handle inputPLY files for cloning, but producing VTK POLYDATA. +shape_mgr = icqsol_utils.get_shape_manager(format, icqsol_utils.POLYDATA) + +if cloning: + # We're cloning an existing shape selected from the history. + tmp_input_path = icqsol_utils.get_input_file_path(tmp_dir, args.shape_input, '.%s' % format) + shape_to_clone = shape_mgr.loadAsShape(tmp_input_path) + new_shape = shape_mgr.cloneShape(shape_to_clone) + if icqsol_utils.asbool(args.rotate): + shape_mgr.rotateShape(new_shape, axis=rotation_axis, angleDeg=args.rotation_degree) + if icqsol_utils.asbool(args.translate): + shape_mgr.translateShape(new_shape, disp=origin) +else: + # Create the primitive shape. + if args.shape == 'box': + new_shape = shape_mgr.createShape('box', + origin=origin, + lengths=lengths) + elif args.shape == 'cone': + new_shape = shape_mgr.createShape('cone', + radius=args.radius, + origin=origin, + lengths=lengths, + n_theta=args.n_theta) + elif args.shape == 'cylinder': + new_shape = shape_mgr.createShape('cylinder', + radius=args.radius, + origin=origin, + lengths=lengths, + n_theta=args.n_theta) + elif args.shape == 'sphere': + new_shape = shape_mgr.createShape('sphere', + radius=args.radius, + origin=origin, + n_theta=args.n_theta, + n_phi=args.n_phi) + +# Save the output. +tmp_output_path = icqsol_utils.get_temporary_file_path(tmp_dir, '.%s' % format) +shape_mgr.saveShape(shape=new_shape, file_name=tmp_output_path, file_type=file_type) +shutil.move(tmp_output_path, args.output)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/icqsol_create_shape.xml Tue Aug 23 15:00:22 2016 -0400 @@ -0,0 +1,206 @@ +<?xml version='1.0' encoding='UTF-8'?> +<tool id="icqsol_create_shape" name="Create shape" version="@WRAPPER_VERSION@.0"> + <description></description> + <macros> + <import>icqsol_macros.xml</import> + </macros> + <expand macro="requirements" /> + <command> + <![CDATA[ + python $__tool_directory__/icqsol_create_shape.py + --create_process $create_process_cond.create_process + #if $create_process_cond.create_process == 'create': + --shape $create_process_cond.shape_cond.shape + #if $create_process_cond.shape_cond.shape == 'box': + @origin_cmd_args@ + @lengths_cmd_args@ + #else if $create_process_cond.shape_cond.shape == 'cone': + @radius_cmd_args@ + @origin_cmd_args@ + @lengths_cmd_args@ + @n_theta_cmd_args@ + #else if $create_process_cond.shape_cond.shape == 'cylinder': + @radius_cmd_args@ + @origin_cmd_args@ + @lengths_cmd_args@ + @n_theta_cmd_args@ + #else if $create_process_cond.shape_cond.shape == 'sphere': + @radius_cmd_args@ + @origin_cmd_args@ + @n_theta_cmd_args@ + @n_phi_cmd_args@ + #end if + --output_vtk_type $create_process_cond.output_vtk_type + --output "$output_create" + #else: + --shape_input "$create_process_cond.shape_input" + --rotate $create_process_cond.rotate_cond.rotate + #if $create_process_cond.rotate_cond.rotate == 'yes': + --rotation_axis_x $create_process_cond.rotate_cond.rotation_axis_x + --rotation_axis_y $create_process_cond.rotate_cond.rotation_axis_y + --rotation_axis_z $create_process_cond.rotate_cond.rotation_axis_z + --rotation_degree $create_process_cond.rotate_cond.rotation_degree + #end if + #if $create_process_cond.translate_cond.translate == 'yes': + --translate $create_process_cond.translate_cond.translate + --origin_x $create_process_cond.translate_cond.translate_origin_x + --origin_y $create_process_cond.translate_cond.translate_origin_y + --origin_z $create_process_cond.translate_cond.translate_origin_z + #end if + --output_vtk_type $create_process_cond.shape_input.ext + --output "$output_clone" + #end if + ]]> + </command> + <inputs> + <conditional name="create_process_cond"> + <param name="create_process" type="select" label="Create or clone?" help="Create a new shape or clone a shape in your history."> + <option value="create" selected="True">Create a shape</option> + <option value="clone">Clone a shape in your history</option> + </param> + <when value="create"> + <conditional name="shape_cond"> + <param name="shape" type="select" label="Select shape"> + <option value="box" selected="True">Box</option> + <option value="cone">Cone</option> + <option value="cylinder">Cylinder</option> + <option value="sphere">Sphere</option> + </param> + <when value="box"> + <expand macro="origin_params" /> + <expand macro="lengths_exclude_min_params" /> + </when> + <when value="cone"> + <expand macro="radius_params" /> + <expand macro="origin_params" /> + <expand macro="lengths_params" /> + <expand macro="n_theta_params" /> + </when> + <when value="cylinder"> + <expand macro="radius_params" /> + <expand macro="origin_params" /> + <expand macro="lengths_params" /> + <expand macro="n_theta_params" /> + </when> + <when value="sphere"> + <expand macro="radius_params" /> + <expand macro="origin_params" /> + <expand macro="n_theta_params" /> + <expand macro="n_phi_params" /> + </when> + </conditional> + <expand macro="output_vtk_type_params" /> + </when> + <when value="clone"> + <param name="shape_input" type="data" format="plyascii,plybinary,vtkascii,vtkbinary" label="Shape to clone" help="Select shape for cloning."> + <validator type="dataset_ok_validator" /> + </param> + <conditional name="rotate_cond"> + <param name="rotate" type="select" label="Rotate cloned shape?"> + <option value="no" selected="True">No</option> + <option value="yes">Yes</option> + </param> + <when value="no"/> + <when value="yes"> + <param name="rotation_axis_x" type="float" value="0.0" label="X coordinate of rotation axis" help="Floating point number"/> + <param name="rotation_axis_y" type="float" value="0.0" label="Y coordinate of rotation axis" help="Floating point number"/> + <param name="rotation_axis_z" type="float" value="0.0" label="Z coordinate of rotation axis" help="Floating point number"/> + <param name="rotation_degree" type="float" value="0.0" label="Degree of rotation" help="Floating point number"/> + </when> + </conditional> + <conditional name="translate_cond"> + <param name="translate" type="select" label="Translate cloned shape?"> + <option value="no" selected="True">No</option> + <option value="yes">Yes</option> + </param> + <when value="no"/> + <when value="yes"> + <param name="translate_origin_x" type="float" value="0.0" label="X coordinate of new origin" help="Floating point number"/> + <param name="translate_origin_y" type="float" value="0.0" label="Y coordinate of new origin" help="Floating point number"/> + <param name="translate_origin_z" type="float" value="0.0" label="Z coordinate of new origin" help="Floating point number"/> + </when> + </conditional> + </when> + </conditional> + </inputs> + <outputs> + <data name="output_create" format="vtkascii" label="${tool.name} ${on_string}: ${create_process_cond.shape_cond.shape}"> + <filter>create_process_cond['create_process'] == "create"</filter> + <actions> + <action type="format"> + <option type="from_param" name="create_process_cond.output_vtk_type" /> + </action> + </actions> + </data> + <data name="output_clone" format_source="shape_input" label="${tool.name}: Cloned ${on_string}"> + <filter>create_process_cond['create_process'] == "clone"</filter> + </data> + </outputs> + <tests> + <test> + <param name="shape" value="cone" /> + <param name="radius" value="0.25" /> + <param name="origin_x" value="-0.06" /> + <param name="length_x" value="0.14" /> + <param name="output_vtk_type" value="vtkascii" /> + <output name="output" file="head.vtkascii" /> + </test> + <test> + <param name="shape" value="box" /> + <param name="origin_x" value="-0.06" /> + <param name="origin_y" value="-0.015" /> + <param name="origin_z" value="-0.15" /> + <param name="length_x" value="0.03" /> + <param name="length_y" value="0.03" /> + <param name="length_z" value="0.30" /> + <param name="output_vtk_type" value="vtkascii" /> + <output name="output" file="notch1.vtkascii" /> + </test> + <test> + <param name="shape" value="cylinder" /> + <param name="radius" value="0.1" /> + <param name="origin_x" value="0.0" /> + <param name="origin_y" value="0.0" /> + <param name="origin_z" value="0.0" /> + <param name="length_x" value="1.0" /> + <param name="length_y" value="0.0" /> + <param name="length_z" value="0.0" /> + <param name="n_theta" value="16" /> + <param name="output_vtk_type" value="vtkascii" /> + <output name="output" file="shaft.vtkascii" /> + </test> + <test> + <param name="create_process" value="clone" /> + <param name="shape_input" value="notch1.vtkascii" ftype="vtkascii" /> + <param name="rotate" value="yes" /> + <param name="rotation_axis_x" value="1.0" /> + <param name="rotation_degree" value="90.0" /> + <output name="output" file="notch2.vtkascii" ftype="vtkascii" /> + </test> + </tests> + <help> +**What it does** + +**Create a shape** - creates a selected primitive shape where shapes are Box, Cone, Cylinder and Sphere. + +* **Origin X,Y,Z** - Origin coordinate for all shapes. +* **Lengths X,Y,Z** - Edge lengths for Box, Cone and Cylinder. +* **Radius** - Radius length for Cone, Cylinder and Sphere. +* **Number of slices** - Controls the tessellation along the longitude direction for all shapes. +* **Number of stacks** - Controls the tessellation along the latitude direction for all shapes. +* **Output format and file type** - Choose the output format **ply** or **vtk** and file type **ascii** or **binary**. + +----- + +**Clone a shape from your history** - creates a new copy of a shape selected from your history. + +* **Shape to clone** - Shape selected from your history for cloning. +* **Rotate cloned shape?** - Enables rotation of the cloned shape around a defined axis. +* **Rotation axis X,Y,Z** - The axis of rotation for the cloned shape. +* **Degree of rotation** - The degree of rotation around the axis. +* **Translate cloned shape?** - Enables resetting the origin of the cloned shape, moving the shape. +* **New origin X,Y,Z** - Translated origin of cloned shape. + + </help> + <expand macro="citations" /> +</tool>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/icqsol_macros.xml Tue Aug 23 15:00:22 2016 -0400 @@ -0,0 +1,116 @@ +<?xml version='1.0' encoding='UTF-8'?> +<macros> + <token name="@WRAPPER_VERSION@">1.0</token> + <xml name="requirements"> + <requirements> + <requirement type="package" version="0.3.26">icqsol</requirement> + </requirements> + </xml> + <xml name="stdio"> + <stdio> + <exit_code range="1:"/> + <exit_code range=":-1"/> + <regex match="Error:"/> + <regex match="Exception:"/> + </stdio> + </xml> + <!-- TODO: place this in colormaps_conf.xml --> + <xml name="color_map_param"> + <param name="color_map" type="select" label="Color map"> + <option value="hot" selected="True">Hot</option> + <option value="cold">Cold</option> + <option value="blackbody">Blackbody</option> + <option value="gnu">Gnu</option> + </param> + </xml> + <xml name="output_vtk_type_params"> + <param name="output_vtk_type" type="select" label="Output file type"> + <option value="vtkascii" selected="True">Vtk-ascii</option> + <option value="vtkbinary">Vtk-binary</option> + </param> + </xml> + <token name="@origin_cmd_args@"> + --origin_x $create_process_cond.shape_cond.origin_x + --origin_y $create_process_cond.shape_cond.origin_y + --origin_z $create_process_cond.shape_cond.origin_z + </token> + <xml name="origin_params"> + <param name="origin_x" type="float" value="0.0" label="X coordinate of origin" help="Floating point number"/> + <param name="origin_y" type="float" value="0.0" label="Y coordinate of origin" help="Floating point number"/> + <param name="origin_z" type="float" value="0.0" label="Z coordinate of origin" help="Floating point number"/> + </xml> + <token name="@lengths_cmd_args@"> + --length_x $create_process_cond.shape_cond.length_x + --length_y $create_process_cond.shape_cond.length_y + --length_z $create_process_cond.shape_cond.length_z + </token> + <xml name="lengths_params"> + <!-- At least one of these lengths must be greater than zero, but we have no validator for this. --> + <param name="length_x" type="float" value="1.0" label="Length in the X direction" help="Floating point number"> + <validator type="in_range" min="0" exclude_min="false" /> + </param> + <param name="length_y" type="float" value="0.0" label="Length in the Y direction" help="Floating point number"> + <validator type="in_range" min="0" exclude_min="false" /> + </param> + <param name="length_z" type="float" value="0.0" label="Length in the Z direction" help="Floating point number"> + <validator type="in_range" min="0" exclude_min="false" /> + </param> + </xml> + <xml name="lengths_exclude_min_params"> + <param name="length_x" type="float" value="1.0" label="Length in the X direction" help="Floating point number"> + <validator type="in_range" min="0" exclude_min="true" /> + </param> + <param name="length_y" type="float" value="1.0" label="Length in the Y direction" help="Floating point number"> + <validator type="in_range" min="0" exclude_min="true" /> + </param> + <param name="length_z" type="float" value="1.0" label="Length in the Z direction" help="Floating point number"> + <validator type="in_range" min="0" exclude_min="true" /> + </param> + </xml> + <token name="@radius_cmd_args@"> + --radius $create_process_cond.shape_cond.radius + </token> + <xml name="radius_params"> + <param name="radius" type="float" value="1.0" label="Radius" help="Floating point number"> + <validator type="in_range" min="0" exclude_min="True" /> + </param> + </xml> + <token name="@n_theta_cmd_args@"> + --n_theta $create_process_cond.shape_cond.n_theta + </token> + <xml name="n_theta_params"> + <param name="n_theta" type="integer" value="16" label="Number of slices" help="Controls the tessellation along the longitude direction"> + <validator type="in_range" min="0" exclude_min="False" /> + </param> + </xml> + <token name="@n_phi_cmd_args@"> + --n_phi $create_process_cond.shape_cond.n_phi + </token> + <xml name="n_phi_params"> + <param name="n_phi" type="integer" value="8" label="Number of stacks" help="Controls the tessellation along the latitude direction"> + <validator type="in_range" min="0" exclude_min="False" /> + </param> + </xml> + <xml name="citations"> + <citations> + <citation type="bibtex"> + @unpublished{None, + author = {None}, + title = {None}, + year = {None}, + eprint = {None}, + url = {https://github.com/gregvonkuster/galaxy-csg} + }</citation> + <citation type="bibtex"> + @misc(Schroeder-Martin-Lorensen2006, + author = "Will Schroeder and + Ken Martin and + Bill Lorensen", + year = "2006", + title = "The Visualization Toolkit (4th ed.)", + publisher = "Kitware", + url = "https://en.wikipedia.org/wiki/Special:BookSources/978-1-930934-19-1") + </citation> + </citations> + </xml> +</macros>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/icqsol_utils.py Tue Aug 23 15:00:22 2016 -0400 @@ -0,0 +1,86 @@ +import os +import sys +import tempfile + +from icqsol.shapes.icqShapeManager import ShapeManager +from icqsol.bem.icqLaplaceSolver import LaplaceSolver + +PLY = 'ply' +POLYDATA = 'POLYDATA' +VTK = 'vtk' + + +def asbool(val): + return str(val).lower() in ['yes', 'true'] + + +def get_format_and_type(galaxy_ext): + # Define the output file format and type. + format = None + datatype = None + if galaxy_ext in ['vtkascii', 'vtkbinary']: + format = VTK + elif galaxy_ext in ['plyascii', 'plybinary']: + format = PLY + if galaxy_ext in ['vtkascii', 'plyascii']: + datatype = 'ascii' + elif galaxy_ext in ['vtkbinary', 'plybinary']: + datatype = 'binary' + return format, datatype + + +def get_input_file_path(tmp_dir, input_file, format): + """ + iCqSol uses file extensions (e.g., .ply, .vtk) when reading and + writing files, so the Galaxy dataset naming convention of + setting all file extensions as .dat must be handled. + """ + file_path = get_temporary_file_path(tmp_dir, format) + # Remove the file so we can create a symlink. + os.remove(file_path) + os.symlink(input_file, file_path) + return file_path + + +def get_laplace_solver(shape_data, max_edge_length=float('inf')): + return LaplaceSolver(shape_data, max_edge_length=max_edge_length) + + +def get_shape_manager(format=None, dataset_type=None): + # Instantiate a ShapeManager. + return ShapeManager(file_format=format, vtk_dataset_type=dataset_type) + + +def get_temp_dir(prefix='tmp-vtk-', dir=None): + """ + Return a temporary directory. + """ + return tempfile.mkdtemp(prefix=prefix, dir=dir) + + +def get_tempfilename(dir=None, suffix=None): + """ + Return a temporary file name. + """ + if suffix is None: + s = None + elif suffix.startswith('.'): + s = suffix + else: + s = '.%s' % suffix + fd, name = tempfile.mkstemp(suffix=s, dir=dir) + os.close(fd) + return name + + +def get_temporary_file_path(tmp_dir, file_extension): + """ + Return the path to a temporary file with a valid VTK format + file extension. + """ + return get_tempfilename(tmp_dir, file_extension) + + +def stop_err(msg): + sys.stderr.write("%s\n" % msg) + sys.exit()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/head.vtkascii Tue Aug 23 15:00:22 2016 -0400 @@ -0,0 +1,65 @@ +# vtk DataFile Version 4.0 +vtk output +ASCII +DATASET POLYDATA +POINTS 34 float +-0.06 0 0 -0.06 0 -0.25 -0.06 -0.0956709 -0.23097 +0.08 0 0 -0.06 -0.176777 -0.176777 -0.06 -0.23097 -0.0956709 +-0.06 -0.25 0 -0.06 -0.23097 0.0956709 -0.06 -0.176777 0.176777 +-0.06 -0.0956709 0.23097 -0.06 0 0.25 -0.06 0.0956709 0.23097 +-0.06 0.176777 0.176777 -0.06 0.23097 0.0956709 -0.06 0.25 0 +-0.06 0.23097 -0.0956709 -0.06 0.176777 -0.176777 -0.06 0.0956709 -0.23097 +-0.06 0 -0.25 -0.06 -0.0956709 -0.23097 -0.06 -0.176777 -0.176777 +-0.06 -0.23097 -0.0956709 -0.06 -0.25 0 -0.06 -0.23097 0.0956709 +-0.06 -0.176777 0.176777 -0.06 -0.0956709 0.23097 -0.06 0 0.25 +-0.06 0.0956709 0.23097 -0.06 0.176777 0.176777 -0.06 0.23097 0.0956709 +-0.06 0.25 0 -0.06 0.23097 -0.0956709 -0.06 0.176777 -0.176777 +-0.06 0.0956709 -0.23097 +POLYGONS 32 128 +3 0 1 2 +3 18 3 19 +3 0 2 4 +3 19 3 20 +3 0 4 5 +3 20 3 21 +3 0 5 6 +3 21 3 22 +3 0 6 7 +3 22 3 23 +3 0 7 8 +3 23 3 24 +3 0 8 9 +3 24 3 25 +3 0 9 10 +3 25 3 26 +3 0 10 11 +3 26 3 27 +3 0 11 12 +3 27 3 28 +3 0 12 13 +3 28 3 29 +3 0 13 14 +3 29 3 30 +3 0 14 15 +3 30 3 31 +3 0 15 16 +3 31 3 32 +3 0 16 17 +3 32 3 33 +3 0 17 1 +3 33 3 18 + +POINT_DATA 34 +NORMALS Normals float +-1 0 0 -1 0 0 -1 0 0 +1 2.30575e-08 6.43464e-09 -1 0 0 -1 0 0 +-1 0 0 -1 0 0 -1 0 0 +-1 0 0 -1 0 0 -1 0 0 +-1 0 0 -1 0 0 -1 0 0 +-1 0 0 -1 0 0 -1 0 0 +0.872506 0 -0.488603 0.872506 -0.18698 -0.451411 0.872506 -0.345495 -0.345495 +0.872506 -0.451411 -0.18698 0.872506 -0.488603 0 0.872506 -0.451411 0.18698 +0.872506 -0.345495 0.345495 0.872506 -0.18698 0.451411 0.872506 0 0.488603 +0.872506 0.18698 0.451411 0.872506 0.345495 0.345495 0.872506 0.451411 0.18698 +0.872506 0.488603 0 0.872506 0.451411 -0.18698 0.872506 0.345495 -0.345495 +0.872506 0.18698 -0.451411
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/notch1.vtkascii Tue Aug 23 15:00:22 2016 -0400 @@ -0,0 +1,33 @@ +# vtk DataFile Version 4.0 +vtk output +ASCII +DATASET POLYDATA +POINTS 24 float +-0.06 -0.015 -0.15 -0.06 -0.015 0.15 -0.06 0.015 0.15 +-0.06 0.015 -0.15 -0.03 -0.015 -0.15 -0.03 0.015 -0.15 +-0.03 0.015 0.15 -0.03 -0.015 0.15 -0.06 -0.015 -0.15 +-0.06 -0.015 -0.15 -0.06 -0.015 0.15 -0.06 -0.015 0.15 +-0.06 0.015 0.15 -0.06 0.015 0.15 -0.06 0.015 -0.15 +-0.06 0.015 -0.15 -0.03 -0.015 -0.15 -0.03 -0.015 -0.15 +-0.03 0.015 -0.15 -0.03 0.015 -0.15 -0.03 0.015 0.15 +-0.03 0.015 0.15 -0.03 -0.015 0.15 -0.03 -0.015 0.15 + +POLYGONS 6 30 +4 0 1 2 3 +4 4 5 6 7 +4 8 16 22 10 +4 14 12 20 18 +4 9 15 19 17 +4 11 23 21 13 + +POINT_DATA 24 +NORMALS Normals float +-1 0 0 -1 0 0 -1 0 0 +-1 0 0 1 0 0 1 0 0 +1 0 0 1 0 0 0 -1 0 +0 0 -1 0 -1 0 0 0 1 +0 1 0 0 0 1 0 1 0 +0 0 -1 0 -1 0 0 0 -1 +0 1 0 0 0 -1 0 1 0 +0 0 1 0 -1 0 0 0 1 +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/notch2.vtkascii Tue Aug 23 15:00:22 2016 -0400 @@ -0,0 +1,33 @@ +# vtk DataFile Version 4.0 +vtk output +ASCII +DATASET POLYDATA +POINTS 24 float +-0.06 -0.15 0.015 -0.06 0.15 0.015 -0.06 0.15 -0.015 +-0.06 -0.15 -0.015 -0.03 -0.15 0.015 -0.03 -0.15 -0.015 +-0.03 0.15 -0.015 -0.03 0.15 0.015 -0.06 -0.15 0.015 +-0.06 -0.15 0.015 -0.06 0.15 0.015 -0.06 0.15 0.015 +-0.06 0.15 -0.015 -0.06 0.15 -0.015 -0.06 -0.15 -0.015 +-0.06 -0.15 -0.015 -0.03 -0.15 0.015 -0.03 -0.15 0.015 +-0.03 -0.15 -0.015 -0.03 -0.15 -0.015 -0.03 0.15 -0.015 +-0.03 0.15 -0.015 -0.03 0.15 0.015 -0.03 0.15 0.015 + +POLYGONS 6 30 +4 0 1 2 3 +4 4 5 6 7 +4 8 16 22 10 +4 14 12 20 18 +4 9 15 19 17 +4 11 23 21 13 + +POINT_DATA 24 +NORMALS Normals float +-1 0 0 -1 0 0 -1 0 0 +-1 0 0 1 0 0 1 0 0 +1 0 0 1 0 0 0 0 1 +0 -1 0 0 0 1 0 1 0 +0 0 -1 0 1 0 0 0 -1 +0 -1 0 0 0 1 0 -1 0 +0 0 -1 0 -1 0 0 0 -1 +0 1 0 0 0 1 0 1 0 +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/shaft.vtkascii Tue Aug 23 15:00:22 2016 -0400 @@ -0,0 +1,103 @@ +# vtk DataFile Version 4.0 +vtk output +ASCII +DATASET POLYDATA +POINTS 66 float +0 0 0 0 0 -0.1 0 -0.0382683 -0.092388 +1 0 -0.1 1 -0.0382683 -0.092388 1 0 0 +0 -0.0707107 -0.0707107 1 -0.0707107 -0.0707107 0 -0.092388 -0.0382683 +1 -0.092388 -0.0382683 0 -0.1 0 1 -0.1 0 +0 -0.092388 0.0382683 1 -0.092388 0.0382683 0 -0.0707107 0.0707107 +1 -0.0707107 0.0707107 0 -0.0382683 0.092388 1 -0.0382683 0.092388 +0 0 0.1 1 0 0.1 0 0.0382683 0.092388 +1 0.0382683 0.092388 0 0.0707107 0.0707107 1 0.0707107 0.0707107 +0 0.092388 0.0382683 1 0.092388 0.0382683 0 0.1 0 +1 0.1 0 0 0.092388 -0.0382683 1 0.092388 -0.0382683 +0 0.0707107 -0.0707107 1 0.0707107 -0.0707107 0 0.0382683 -0.092388 +1 0.0382683 -0.092388 0 0 -0.1 0 -0.0382683 -0.092388 +1 0 -0.1 1 -0.0382683 -0.092388 0 -0.0707107 -0.0707107 +1 -0.0707107 -0.0707107 0 -0.092388 -0.0382683 1 -0.092388 -0.0382683 +0 -0.1 0 1 -0.1 0 0 -0.092388 0.0382683 +1 -0.092388 0.0382683 0 -0.0707107 0.0707107 1 -0.0707107 0.0707107 +0 -0.0382683 0.092388 1 -0.0382683 0.092388 0 0 0.1 +1 0 0.1 0 0.0382683 0.092388 1 0.0382683 0.092388 +0 0.0707107 0.0707107 1 0.0707107 0.0707107 0 0.092388 0.0382683 +1 0.092388 0.0382683 0 0.1 0 1 0.1 0 +0 0.092388 -0.0382683 1 0.092388 -0.0382683 0 0.0707107 -0.0707107 +1 0.0707107 -0.0707107 0 0.0382683 -0.092388 1 0.0382683 -0.092388 + +POLYGONS 48 208 +3 0 1 2 +4 35 34 3 4 +3 5 37 36 +3 0 2 6 +4 38 35 4 7 +3 5 39 37 +3 0 6 8 +4 40 38 7 9 +3 5 41 39 +3 0 8 10 +4 42 40 9 11 +3 5 43 41 +3 0 10 12 +4 44 42 11 13 +3 5 45 43 +3 0 12 14 +4 46 44 13 15 +3 5 47 45 +3 0 14 16 +4 48 46 15 17 +3 5 49 47 +3 0 16 18 +4 50 48 17 19 +3 5 51 49 +3 0 18 20 +4 52 50 19 21 +3 5 53 51 +3 0 20 22 +4 54 52 21 23 +3 5 55 53 +3 0 22 24 +4 56 54 23 25 +3 5 57 55 +3 0 24 26 +4 58 56 25 27 +3 5 59 57 +3 0 26 28 +4 60 58 27 29 +3 5 61 59 +3 0 28 30 +4 62 60 29 31 +3 5 63 61 +3 0 30 32 +4 64 62 31 33 +3 5 65 63 +3 0 32 1 +4 34 64 33 3 +3 5 36 65 + +POINT_DATA 66 +NORMALS Normals float +-1 0 0 -1 0 0 -1 0 0 +0 0 -1 0 -0.382683 -0.92388 1 0 0 +-1 0 0 0 -0.707107 -0.707107 -1 0 0 +0 -0.92388 -0.382683 -1 0 0 0 -1 0 +-1 0 0 0 -0.92388 0.382683 -1 0 0 +0 -0.707107 0.707107 -1 0 0 0 -0.382683 0.92388 +-1 0 0 0 0 1 -1 0 0 +0 0.382683 0.92388 -1 0 0 0 0.707107 0.707107 +-1 0 0 0 0.92388 0.382683 -1 0 0 +0 1 0 -1 0 0 0 0.92388 -0.382683 +-1 0 0 0 0.707107 -0.707107 -1 0 0 +0 0.382683 -0.92388 0 0 -1 0 -0.382683 -0.92388 +1 0 0 1 0 0 0 -0.707107 -0.707107 +1 0 0 0 -0.92388 -0.382683 1 0 0 +0 -1 0 1 0 0 0 -0.92388 0.382683 +1 0 0 0 -0.707107 0.707107 1 0 0 +0 -0.382683 0.92388 1 0 0 0 0 1 +1 0 0 0 0.382683 0.92388 1 0 0 +0 0.707107 0.707107 1 0 0 0 0.92388 0.382683 +1 0 0 0 1 0 1 0 0 +0 0.92388 -0.382683 1 0 0 0 0.707107 -0.707107 +1 0 0 0 0.382683 -0.92388 1 0 0 +