Mercurial > repos > greg > icqsol_add_texture
comparison icqsol_add_texture.py @ 3:1371f6eeb73c draft
Uploaded
author | greg |
---|---|
date | Mon, 14 Dec 2015 20:01:09 -0500 |
parents | 4afbbfafc3c2 |
children | fbef32d5ded0 |
comparison
equal
deleted
inserted
replaced
2:eb0b9337e095 | 3:1371f6eeb73c |
---|---|
27 else: | 27 else: |
28 shape_mgr = ShapeManager(file_format=input_format) | 28 shape_mgr = ShapeManager(file_format=input_format) |
29 | 29 |
30 # Get the vtk polydata from the input dataset. | 30 # Get the vtk polydata from the input dataset. |
31 vtk_poly_data = shape_mgr.loadAsVtkPolyData(args.input) | 31 vtk_poly_data = shape_mgr.loadAsVtkPolyData(args.input) |
32 # The ShapeManager.addTextureToVtkPolyData function expects | |
33 # a specific file extension at the end of the file path. | |
34 tmp_texture_file_path = icqsol_utils.get_input_file_path(tmp_dir, args.input_texture, args.input_texture_file_format) | |
35 | 32 |
36 # Apply the texture to the shape's surface. | 33 # Apply the texture to the shape's surface. |
37 vtk_poly_data = shape_mgr.addTextureToVtkPolyData(vtk_poly_data, | 34 vtk_poly_data = shape_mgr.addTextureToVtkPolyData(vtk_poly_data, |
38 texture_file=tmp_texture_file_path, | 35 texture_file=args.input_texture, |
39 max_edge_length=args.max_edge_length) | 36 max_edge_length=args.max_edge_length, |
37 texture_file_format=args.input_texture_file_format) | |
40 | 38 |
41 # Define the output file format and type (the output_format can only be 'vtk'). | 39 # Define the output file format and type (the output_format can only be 'vtk'). |
42 output_format, output_file_type = icqsol_utils.get_format_and_type(args.output_vtk_type) | 40 output_format, output_file_type = icqsol_utils.get_format_and_type(args.output_vtk_type) |
43 tmp_output_path = icqsol_utils.get_temporary_file_path(tmp_dir, output_format) | 41 tmp_output_path = icqsol_utils.get_temporary_file_path(tmp_dir, output_format) |
44 | 42 |