function stla_io_test06 %*****************************************************************************80 % %% TEST06 uses MATLAB's TRIMESH routine to display STLA data. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 24 September 2005 % % Author: % % John Burkardt % face_num = 12; node_num = 8; face_node = [ ... 1, 3, 2; ... 2, 3, 4; ... 1, 6, 5; ... 1, 2, 6; ... 3, 7, 4; ... 4, 7, 8; ... 5, 6, 8; ... 5, 8, 7; ... 1, 5, 7; ... 1, 7, 3; ... 2, 4, 6; ... 6, 4, 8 ]'; face_normal = [ ... 0.0, 0.0, -1.0; ... 0.0, 0.0, -1.0; ... 0.0, -1.0, 0.0; ... 0.0, -1.0, 0.0; ... 0.0, +1.0, 0.0; ... 0.0, +1.0, 0.0; ... 0.0, 0.0, +1.0; ... 0.0, 0.0, +1.0; ... -1.0, 0.0, 0.0; ... -1.0, 0.0, 0.0; ... +1.0, 0.0, 0.0; ... +1.0, 0.0, 0.0 ]'; node_xyz = [ ... 0.0, 0.0, 0.0; ... 1.0, 0.0, 0.0; ... 0.0, 1.0, 0.0; ... 1.0, 1.0, 0.0; ... 0.0, 0.0, 1.0; ... 1.0, 0.0, 1.0; ... 0.0, 1.0, 1.0; ... 1.0, 1.0, 1.0 ]'; fprintf ( 1, '\n' ); fprintf ( 1, 'TEST06\n' ); fprintf ( 1, ' The MATLAB routine TRIMESH will plot a triangulated surface.\n' ); fprintf ( 1, ' It can be used to display the object described by an\n' ); fprintf ( 1, ' ASCII STL file.\n' ); trimesh ( face_node', node_xyz(1,:), node_xyz(2,:), node_xyz(3,:) ); xlabel ( 'X' ) ylabel ( 'Y' ) zlabel ( 'Z' ) return end