Changeset 4393
- Timestamp:
- Jun 18, 2014, 9:17:01 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/mesh.tcl
r4390 r4393 454 454 return $value 455 455 } 456 457 456 458 457 itcl::body Rappture::Mesh::ReadVtk { path } { … … 789 788 set _type "triangles" 790 789 set _numPoints [$xv length] 791 set count0790 set _numCells 0 792 791 set data {} 793 792 set celltypes {} … … 795 794 append data " 3 $a $b $c\n" 796 795 append celltypes "5\n" 797 incr count796 incr _numCells 798 797 } 799 798 append out "DATASET UNSTRUCTURED_GRID\n" … … 802 801 append out " $x $y $z\n" 803 802 } 804 append out "CELLS $count [expr $count * 4]\n" 803 set count [expr $_numCells * 4] 804 append out "CELLS $_numCells $count\n" 805 805 append out $data 806 append out "CELL_TYPES $ count\n"806 append out "CELL_TYPES $_numCells\n" 807 807 append out $celltypes 808 808 set _limits(x) [$xv limits] … … 820 820 set _type "quads" 821 821 set _numPoints [$xv length] 822 set count0822 set _numCells 0 823 823 set data {} 824 824 set celltypes {} … … 826 826 append data " 4 $a $b $c $d\n" 827 827 append celltypes "9\n" 828 incr count828 incr _numCells 829 829 } 830 830 append out "DATASET UNSTRUCTURED_GRID\n" … … 833 833 append out " $x $y $z\n" 834 834 } 835 append out "CELLS $count [expr $count * 5]\n" 835 set count [expr $_numCells * 5] 836 append out "CELLS $_numCells $count\n" 836 837 append out $data 837 append out "CELL_TYPES $ count\n"838 append out "CELL_TYPES $_numCells\n" 838 839 append out $celltypes 839 840 set _limits(x) [$xv limits] … … 851 852 set _type "tetrahedrons" 852 853 set _numPoints [$xv length] 853 set count0854 set _numCells 0 854 855 set data {} 855 856 set celltypes {} … … 857 858 append data " 4 $a $b $c $d\n" 858 859 append celltypes "10\n" 859 incr count860 incr _numCells 860 861 } 861 862 append out "DATASET UNSTRUCTURED_GRID\n" … … 864 865 append out " $x $y $z\n" 865 866 } 866 append out "CELLS $count [expr $count * 5]\n" 867 set count [expr $_numCells * 5] 868 append out "CELLS $_numCells $count\n" 867 869 append out $data 868 append out "CELL_TYPES $ count\n"870 append out "CELL_TYPES $_numCells\n" 869 871 append out $celltypes 870 872 set _limits(x) [$xv limits] … … 879 881 set _type "hexahedrons" 880 882 set _numPoints [$xv length] 881 set count0883 set _numCells 0 882 884 set data {} 883 885 set celltypes {} … … 885 887 append data " 8 $a $b $c $d $e $f $g $h\n" 886 888 append celltypes "12\n" 887 incr count889 incr _numCells 888 890 } 889 891 append out "DATASET UNSTRUCTURED_GRID\n" … … 892 894 append out " $x $y $z\n" 893 895 } 894 append out "CELLS $count [expr $count * 9]\n" 896 set count [expr $_numCells * 9] 897 append out "CELLS $_numCells $count\n" 895 898 append out $data 896 append out "CELL_TYPES $ count\n"899 append out "CELL_TYPES $_numCells\n" 897 900 append out $celltypes 898 901 set _limits(x) [$xv limits] … … 907 910 set _type "wedges" 908 911 set _numPoints [$xv length] 909 set count0912 set _numCells 0 910 913 set data {} 911 914 set celltypes {} … … 913 916 append data " 6 $a $b $c $d $e $f\n" 914 917 append celltypes "13\n" 915 incr count918 incr _numCells 916 919 } 917 920 append out "DATASET UNSTRUCTURED_GRID\n" … … 920 923 append out " $x $y $z\n" 921 924 } 922 append out "CELLS $count [expr $count * 7]\n" 925 set count [expr $_numCells * 7] 926 append out "CELLS $_numCells $count\n" 923 927 append out $data 924 append out "CELL_TYPES $ count\n"928 append out "CELL_TYPES $_numCells\n" 925 929 append out $celltypes 926 930 set _limits(x) [$xv limits] … … 935 939 set _type "pyramids" 936 940 set _numPoints [$xv length] 937 set count0941 set _numCells 0 938 942 set data {} 939 943 set celltypes {} … … 941 945 append data " 5 $a $b $c $d $e\n" 942 946 append celltypes "14\n" 943 incr count947 incr _numCells 944 948 } 945 949 append out "DATASET UNSTRUCTURED_GRID\n" … … 948 952 append out " $x $y $z\n" 949 953 } 950 append out "CELLS $count [expr $count * 6]\n" 954 set count [expr $_numCells * 6] 955 append out "CELLS $_numCells $count\n" 951 956 append out $data 952 append out "CELL_TYPES $ count\n"957 append out "CELL_TYPES $_numCells\n" 953 958 append out $celltypes 954 959 set _limits(x) [$xv limits]
Note: See TracChangeset
for help on using the changeset viewer.