Commit message:
Uploaded |
added:
icqsol_compose_shapes.py icqsol_compose_shapes.xml icqsol_macros.xml icqsol_utils.py test-data/head.vtkascii test-data/notch1.vtkascii test-data/notch2.vtkascii test-data/philips_bolt.vtkascii test-data/shaft.vtkascii |
b |
diff -r 000000000000 -r 1574fdcc16df icqsol_compose_shapes.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/icqsol_compose_shapes.py Tue Aug 23 14:59:12 2016 -0400 |
[ |
@@ -0,0 +1,43 @@ +#!/usr/bin/env python +import argparse +import shutil + +import icqsol_utils + +# Parse Command Line. +parser = argparse.ArgumentParser() +parser.add_argument('--expression', dest='expression', help='Composition expression') +parser.add_argument('--shape_dataset', dest='shape_datasets', action='append', nargs=4, help='Shape datasets selected from history') +parser.add_argument('--output', dest='output', help='Output dataset') +parser.add_argument('--output_vtk_type', dest='output_vtk_type', help='Output file format and type') + +args = parser.parse_args() + +tmp_dir = icqsol_utils.get_temp_dir() +shape_tuples = [] +shape_mgr = icqsol_utils.get_shape_manager() + +# Load the shapes. +for (expression_var, dataset_path, galaxy_ext, vtk_dataset_type) in args.shape_datasets: + # Define the file format and type. + format, file_type = icqsol_utils.get_format_and_type(galaxy_ext) + if format == icqsol_utils.VTK: + shape_mgr.setReader(file_format=format, vtk_dataset_type=vtk_dataset_type) + else: + shape_mgr.setReader(file_format=format) + icqsol_path = icqsol_utils.get_input_file_path(tmp_dir, dataset_path, format) + shape_tuple = (expression_var, shape_mgr.loadAsShape(icqsol_path)) + shape_tuples.append(shape_tuple) + +# Define the output file format and type. +output_format, output_file_type = icqsol_utils.get_format_and_type(args.output_vtk_type) +tmp_output_path = icqsol_utils.get_temporary_file_path(tmp_dir, output_format) + +shape_mgr.setWriter(file_format=output_format, vtk_dataset_type=icqsol_utils.POLYDATA) + +# Compose the shapes. +composite_shape = shape_mgr.composeShapes(shape_tuples, args.expression) + +# Save the output. +shape_mgr.saveShape(shape=composite_shape, file_name=tmp_output_path, file_type=output_file_type) +shutil.move(tmp_output_path, args.output) |
b |
diff -r 000000000000 -r 1574fdcc16df icqsol_compose_shapes.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/icqsol_compose_shapes.xml Tue Aug 23 14:59:12 2016 -0400 |
[ |
@@ -0,0 +1,74 @@ +<?xml version='1.0' encoding='UTF-8'?> +<tool id="icqsol_compose_shapes" name="Compose shapes" version="@WRAPPER_VERSION@.0"> + <description></description> + <macros> + <import>icqsol_macros.xml</import> + </macros> + <expand macro="requirements" /> + <command> + <![CDATA[ + python $__tool_directory__/icqsol_compose_shapes.py + --expression "$expression" + #for $i in $input_shapes: + --shape_dataset "${i.expression_var}" "${i.input_shape}" "${i.input_shape.ext}" "${i.input_shape.metadata.dataset_type}" + #end for + --output "$output" + --output_vtk_type $output_vtk_type + ]]> + </command> + <inputs> + <param name="expression" type="text" value="" label="Composition expression" help="Example: A + B - C * D"/> + <repeat name="input_shapes" title="Expression variable and shape" min="2"> + <param name="expression_var" type="text" value="" label="Expression variable" help="The selected shape will be associated with this variable in the expression."/> + <param name="input_shape" type="data" format="plyascii,plybinary,vtkascii,vtkbinary" label="Shape"> + <validator type="dataset_ok_validator" /> + </param> + </repeat> + <expand macro="output_vtk_type_params" /> + </inputs> + <outputs> + <data name="output" format="vtkascii"> + <actions> + <action type="format"> + <option type="from_param" name="output_vtk_type" /> + </action> + </actions> + </data> + </outputs> + <tests> + <test> + <param name="expression" value="head + shaft - notch1 - notch2" /> + <repeat name="input_shapes"> + <param name="expression_var" value="head" /> + <param name="input_shape" value="head.vtkascii" ftype="vtkascii" /> + </repeat> + <repeat name="input_shapes"> + <param name="expression_var" value="shaft" /> + <param name="input_shape" value="shaft.vtkascii" ftype="vtkascii" /> + </repeat> + <repeat name="input_shapes"> + <param name="expression_var" value="notch1" /> + <param name="input_shape" value="notch1.vtkascii" ftype="vtkascii" /> + </repeat> + <repeat name="input_shapes"> + <param name="expression_var" value="notch2" /> + <param name="input_shape" value="notch2.vtkascii" ftype="vtkascii" /> + </repeat> + <output name="output" file="philips_bolt.vtkascii" ftype="vtkascii" /> + <param name="output_vtk_type" value="vtkascii" /> + </test> + </tests> + <help> +**What it does** + +Creates a shape composed of any number of selected shapes where the composition is based on a mathematical +expression consisting of **+**, **-** and ***** operations. The **+** results in a union of shapes, the +**-** operator removes a shape and the ***** operator results in an intersection of shapes. + +For example, if the **Composition expression** is **A + B - C - D**, selecting 4 shapes from your history +and associating each shape with a variable from the expression will result in a shape composed of the shapes +associated with A and B, but eliminating the shapes associated with C and D. + + </help> + <expand macro="citations" /> +</tool> |
b |
diff -r 000000000000 -r 1574fdcc16df icqsol_macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/icqsol_macros.xml Tue Aug 23 14:59:12 2016 -0400 |
b |
@@ -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> |
b |
diff -r 000000000000 -r 1574fdcc16df icqsol_utils.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/icqsol_utils.py Tue Aug 23 14:59:12 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() |
b |
diff -r 000000000000 -r 1574fdcc16df test-data/head.vtkascii --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/head.vtkascii Tue Aug 23 14:59:12 2016 -0400 |
b |
@@ -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 |
b |
diff -r 000000000000 -r 1574fdcc16df test-data/notch1.vtkascii --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/notch1.vtkascii Tue Aug 23 14:59:12 2016 -0400 |
b |
@@ -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 + |
b |
diff -r 000000000000 -r 1574fdcc16df test-data/notch2.vtkascii --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/notch2.vtkascii Tue Aug 23 14:59:12 2016 -0400 |
b |
@@ -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 + |
b |
diff -r 000000000000 -r 1574fdcc16df test-data/philips_bolt.vtkascii --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/philips_bolt.vtkascii Tue Aug 23 14:59:12 2016 -0400 |
b |
b'@@ -0,0 +1,586 @@\n+# vtk DataFile Version 4.0\n+vtk output\n+ASCII\n+DATASET POLYDATA\n+POINTS 432 float\n+-0.06 -0.0362132 0.015 -0.06 -0.247016 0.015 -0.06 -0.23097 0.0956709 \n+-0.06 -0.015 0.015 -0.06 -0.176777 0.176777 -0.06 -0.015 0.0362132 \n+-0.06 -0.0956709 0.23097 -0.06 -0.015 0.247016 -0.06 0.015 0.0362132 \n+-0.06 0.015 0.247016 -0.06 0.0956709 0.23097 -0.06 0.015 0.015 \n+-0.06 0.176777 0.176777 -0.06 0.0362132 0.015 -0.06 0.23097 0.0956709 \n+-0.06 0.247016 0.015 -0.06 0 0.15 -0.06 -0.015 0.15 \n+-0.06 0 0.25 -0.06 0.015 0.15 -0.06 -0.015 -0.0362132 \n+-0.06 -0.015 -0.247016 -0.06 -0.0956709 -0.23097 -0.06 -0.015 -0.015 \n+-0.06 -0.176777 -0.176777 -0.06 -0.0362132 -0.015 -0.06 -0.23097 -0.0956709 \n+-0.06 -0.247016 -0.015 -0.06 0.0362132 -0.015 -0.06 0.247016 -0.015 \n+-0.06 0.23097 -0.0956709 -0.06 0.015 -0.015 -0.06 0.176777 -0.176777 \n+-0.06 0.015 -0.0362132 -0.06 0.0956709 -0.23097 -0.06 0.015 -0.247016 \n+-0.06 -0.015 -0.15 -0.06 0 -0.15 -0.06 0 -0.25 \n+-0.06 0.015 -0.15 -0.06 -0.15 0 -0.06 -0.15 -0.015 \n+-0.06 -0.25 0 -0.06 -0.15 0.015 -0.06 0.15 0 \n+-0.06 0.15 0.015 -0.06 0.25 0 -0.06 0.15 -0.015 \n+-0.03 -0.1 0 -0.03 -0.0970163 0.015 -0.03 -0.015 0.015 \n+-0.03 -0.015 -0.015 -0.03 -0.0970163 -0.015 -0.03 0 -0.1 \n+-0.03 -0.015 -0.0970163 -0.03 -0.015 0.0970163 -0.03 0 0.1 \n+-0.03 0.015 0.0970163 -0.03 0.015 -0.0970163 -0.03 0.015 -0.102984 \n+-0.03 0.015 -0.15 -0.03 -0.015 -0.15 -0.03 0.015 0.102984 \n+-0.03 -0.015 0.107935 -0.03 0.015 0.127981 -0.03 -0.015 0.15 \n+-0.03 0.015 0.15 -0.03 -0.102984 0.015 -0.03 -0.127981 0.015 \n+-0.03 -0.107935 -0.015 -0.03 -0.15 -0.015 -0.03 -0.15 0.015 \n+-0.03 0.015 0.015 -0.03 0.0970163 0.015 -0.03 0.1 0 \n+-0.03 0.0970163 -0.015 -0.03 0.015 -0.015 -0.03 0.102984 -0.015 \n+-0.03 0.107935 0.015 -0.03 0.127981 -0.015 -0.03 0.15 0.015 \n+-0.03 0.15 -0.015 -0.03 -0.015 -0.193445 -0.03 -0.07517 -0.181476 \n+-0.03 0 -0.196429 -0.03 -0.138896 -0.138896 -0.06 -0.015 0.0970163 \n+-0.06 -0.015 0.107935 -0.06 -0.015 -0.0970163 -0.06 0.015 0.0970163 \n+-0.06 0.015 0.127981 -0.06 0.015 0.102984 -0.06 0.015 -0.102984 \n+-0.06 0.015 -0.0970163 -0.03 -0.015 0.193445 -0.03 0 0.196429 \n+-0.03 0.011732 0.194095 -0.033103 0.015 0.198986 -0.03 0.015 0.193445 \n+-0.03 0.015 -0.193445 -0.03 0.145542 -0.12895 -0.03 0.138896 -0.138896 \n+-0.06 0.20132 -0.140045 -0.03 0.181476 -0.07517 -0.03 0.174831 -0.0851161 \n+-0.06 0.206427 -0.132403 -0.03 0.07517 -0.181476 -0.06 0.0433279 0.241382 \n+-0.03 0.07517 0.181476 -0.03 0.0851161 0.174831 -0.06 0.132403 0.206427 \n+-0.03 0.138896 0.138896 -0.03 0.145542 0.12895 -0.06 0.20132 0.140045 \n+-0.03 0.181476 0.07517 -0.03 0.18381 0.0634381 -0.06 0.239588 0.0523431 \n+-0.03 0.193445 0.015 -0.03 0.196429 0 -0.033103 0.198986 -0.015 \n+-0.06 0.241382 -0.0433279 -0.03 0.193445 -0.015 -0.03 0.194095 -0.011732 \n+-0.03 -0.181476 -0.07517 -0.03 -0.18381 -0.0634381 -0.06 -0.239588 -0.0523431 \n+-0.03 -0.193445 -0.015 -0.03 -0.196429 0 -0.033103 -0.198986 0.015 \n+-0.06 -0.241382 0.0433279 -0.03 -0.193445 0.015 -0.03 -0.181476 0.07517 \n+-0.03 -0.194095 0.011732 -0.03 -0.174831 0.0851161 -0.06 -0.206427 0.132403 \n+-0.03 -0.138896 0.138896 -0.03 -0.12895 0.145542 -0.06 -0.140045 0.20132 \n+-0.03 -0.07517 0.181476 -0.03 -0.0634381 0.18381 -0.06 -0.0523431 0.239588 \n+0.024 0 -0.1 1 0 -0.1 1 -0.0382683 -0.092388 \n+0.024 -0.0382683 -0.092388 0 0 -0.142857 0 -0.0546691 -0.131983 \n+0.024 -0.0382684 -0.092388 0 -0.101015 -0.101015 0.0139436 -0.083409 -0.083409 \n+0 -0.117282 -0.0766714 -0.0188606 -0.163099 -0.0675578 -0.0188603 0.12483 -0.12483 \n+0 0.0790133 -0.115717 0 0.0546691 -0.131983 0.0139436 0.0451406 -0.108979 \n+1 0 0 1 -0.0707107 -0.0707107 1 -0.092388 -0.0382683 \n+1 -0.1 0 1 -0.092388 0.0382683 1 -0.0707107 0.0707107 \n+1 -0.0382683 0.092388 1 0 0.1 1 0.0382683 0.092388 \n+1 0.0707107 0.0707107 1 0.092388 0.0382683 1 0.1 0 \n+1 0.092388 -0.0382683 1 0.0707107 -0.0707107 1 0.0382683 -0.092388 \n+0.0325255 -0.0707107 -0.0707107 0.0240001 -0.0707107 -0.0707107 0 -0.131983 -0.0546691 \n+0.0139435 -0.108979 -0.'..b'463565 0.872506 -2.61999e-08 0.488603 \n+0.872506 2.80713e-08 0.488603 0.868414 0.0967329 0.486312 0.872506 0.186979 0.451411 \n+0 0 1 0 0 1 0 0 1 \n+0 0 1 0 0 1 0 0 1 \n+0 0 1 0 0.0661586 0.997809 0.872506 0.186979 0.451411 \n+0.872506 0.186979 0.451411 0.868414 0.275472 0.412276 0.872506 0.345494 0.345494 \n+0 0.345655 0.938362 1.01376e-08 0.382683 0.92388 1.01376e-08 0.382683 0.92388 \n+0 0.382683 0.92388 0 0.382683 0.92388 0 0.382683 0.92388 \n+0 0.382683 0.92388 0 0.442967 0.896538 0.872049 0.216796 0.438783 \n+0.872506 0.345494 0.345494 0.872506 0.345494 0.345494 0.868415 0.412276 0.275472 \n+0.872506 0.451411 0.186979 0 0.707107 0.707107 1.98857e-08 0.55557 0.83147 \n+7.88486e-09 0.707107 0.707107 7.88486e-09 0.707107 0.707107 0 0.707107 0.707107 \n+0 0.707107 0.707107 0 0.707107 0.707107 0 0.752339 0.658776 \n+0.872506 0.451411 0.186979 0.872506 0.451411 0.186979 0.868414 0.486312 0.0967329 \n+0.872506 0.488603 1.27257e-07 0 0.92388 0.382683 1.54667e-08 0.83147 0.55557 \n+2.21291e-08 0.92388 0.382683 2.21291e-08 0.92388 0.382683 0 0.92388 0.382683 \n+0 0.92388 0.382683 0 0.947174 0.320722 0.872049 0.463565 0.156967 \n+0.872506 0.488603 2.61999e-08 0.872506 0.488603 -2.80713e-08 0.868414 0.486312 -0.0967329 \n+0.872506 0.451411 -0.186979 0 1 0 4.34078e-08 0.980785 0.195089 \n+2.85606e-08 1 -4.55793e-08 2.85606e-08 1 0 0 1 0 \n+0 0.997809 -0.0661586 0.872506 0.451411 -0.186979 0.872506 0.451411 -0.186979 \n+0.868414 0.412276 -0.275472 0 0.92388 -0.382683 5.60236e-08 0.980785 -0.19509 \n+9.0283e-09 0.92388 -0.382683 9.0283e-09 0.92388 -0.382683 0 0.896538 -0.442967 \n+0.872049 0.438783 -0.216796 0.872506 0.345494 -0.345494 0.872506 0.345494 -0.345494 \n+0.868414 0.275472 -0.412276 0 0.707107 -0.707107 1.77096e-08 0.83147 -0.55557 \n+1.36809e-08 0.707107 -0.707107 1.82012e-08 0.658776 -0.752339 0 0.382683 -0.92388 \n+2.6836e-08 0.55557 -0.83147 1.18799e-07 0.320722 -0.947174 0.872049 0.156967 -0.463565 \n+0.868414 0.0967329 -0.486312 1.75158e-07 0.195089 -0.980785 -1 0 0 \n+0.868414 -0.486312 0.0967328 0.872506 -0.451411 0.186979 0 0 -1 \n+0 1 0 0.872506 -0.345494 0.345494 0.872506 -0.186979 0.451411 \n+-1 0 0 0.868414 -0.0967328 0.486312 -1 0 0 \n+0.868414 0.0967328 0.486312 0.872506 0.186979 0.451411 0 0 -1 \n+0 -1 0 0.872506 0.345494 0.345494 0.872506 0.451411 0.186979 \n+-1 0 0 0.868414 0.486312 0.0967328 0 1 0 \n+0 0 -1 0.872506 1.87142e-08 0.488603 0 -1 0 \n+0 0 -1 -1 0 0 0.868414 -0.0967328 -0.486312 \n+0.872506 -0.186979 -0.451411 0 1 0 0 0 1 \n+0.872506 -0.345494 -0.345494 0.872506 -0.451411 -0.186979 -1 0 0 \n+0.868414 -0.486312 -0.0967328 -1 0 0 0.868414 0.486312 -0.0967328 \n+0.872506 0.451411 -0.186979 0 -1 0 0 0 1 \n+0.872506 0.345494 -0.345494 0.872506 0.186979 -0.451411 -1 0 0 \n+0.868414 0.0967328 -0.486312 0 1 0 0 0 1 \n+0.872506 0 -0.488603 0 -1 0 0 0 1 \n+0 0 1 0 1 0 0.872506 -0.488603 1.87142e-08 \n+0 0 -1 0 1 0 0 0 -1 \n+0 -1 0 0.872506 0.488603 -1.87142e-08 0 0 1 \n+0 -1 0 0 0 -1 0 1 0 \n+0 1 0 0 0 1 -1 0 0 \n+-1 0 0 0 1 0 -1 0 0 \n+0 1 0 0 -1 0 0 -1 0 \n+-1 0 0 0 -1 0 0 -1 0 \n+0 0 1 0 1 0 0 0 1 \n+-1 0 0 0 -1 0 0 1 0 \n+0 -1 0 0 1 0 0 0 -1 \n+0 -1 0 0 0 -1 -1 0 0 \n+0 0 1 0 1 0 0 0 -1 \n+0 1 0 0 0 -1 0 -1 0 \n+-1 0 0 0 -1 0 0 0 1 \n+-1 0 0 0 0 -1 0 -1 0 \n+0 0 1 0 -1 0 0.872506 0 -0.488603 \n+0.872506 1.12285e-08 -0.488603 3.50317e-07 0.195089 -0.980785 0.868414 0.0967328 -0.486312 \n+1 0 0 1 0 0 0.872049 0.216796 -0.438783 \n+0 -0.707107 -0.707107 0 -0.92388 -0.382683 0 -1 0 \n+0 -0.92388 0.382683 0 -0.707107 0.707107 0 -0.382683 0.92388 \n+0 0 1 0 0.382683 0.92388 0 0.707107 0.707107 \n+0 0.92388 0.382683 0 1 0 0 0.92388 -0.382683 \n+0 0.707107 -0.707107 0 0.382683 -0.92388 0.872049 -0.368209 -0.322417 \n+0.872048 -0.488347 0.0323792 0.872049 -0.322417 0.368209 0.872048 0.0323792 0.488347 \n+1.34872e-08 0.658776 0.752339 0.872049 0.368209 0.322417 1.04901e-08 0.896538 0.442967 \n+2.94408e-08 0.997809 0.0661585 0.872048 0.488347 -0.0323792 3.79973e-08 0.947174 -0.320722 \n+1.20114e-08 0.752339 -0.658776 0.872049 0.322417 -0.368209 1.82012e-08 0.442967 -0.896538 \n+\n' |
b |
diff -r 000000000000 -r 1574fdcc16df test-data/shaft.vtkascii --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/shaft.vtkascii Tue Aug 23 14:59:12 2016 -0400 |
b |
@@ -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 + |