Changeset 4472 for branches/1.3/gui
- Timestamp:
- Jul 9, 2014 6:46:04 PM (10 years ago)
- Location:
- branches/1.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/gui/scripts/mesh.tcl
r4471 r4472 392 392 return $value 393 393 } 394 395 394 396 395 itcl::body Rappture::Mesh::ReadVtk { path } { … … 671 670 set _type "triangles" 672 671 set _numPoints [$xv length] 673 set count0672 set _numCells 0 674 673 set data {} 675 674 set celltypes {} … … 677 676 append data " 3 $a $b $c\n" 678 677 append celltypes "5\n" 679 incr count678 incr _numCells 680 679 } 681 680 append out "DATASET UNSTRUCTURED_GRID\n" … … 684 683 append out " $x $y $z\n" 685 684 } 686 append out "CELLS $count [expr $count * 4]\n" 685 set count [expr $_numCells * 4] 686 append out "CELLS $_numCells $count\n" 687 687 append out $data 688 append out "CELL_TYPES $ count\n"688 append out "CELL_TYPES $_numCells\n" 689 689 append out $celltypes 690 690 set _limits(x) [$xv limits] … … 700 700 set _type "quads" 701 701 set _numPoints [$xv length] 702 set count0702 set _numCells 0 703 703 set data {} 704 704 set celltypes {} … … 706 706 append data " 4 $a $b $c $d\n" 707 707 append celltypes "9\n" 708 incr count708 incr _numCells 709 709 } 710 710 append out "DATASET UNSTRUCTURED_GRID\n" … … 713 713 append out " $x $y $z\n" 714 714 } 715 append out "CELLS $count [expr $count * 5]\n" 715 set count [expr $_numCells * 5] 716 append out "CELLS $_numCells $count\n" 716 717 append out $data 717 append out "CELL_TYPES $ count\n"718 append out "CELL_TYPES $_numCells\n" 718 719 append out $celltypes 719 720 set _limits(x) [$xv limits] … … 729 730 set _type "tetrahedrons" 730 731 set _numPoints [$xv length] 731 set count0732 set _numCells 0 732 733 set data {} 733 734 set celltypes {} … … 735 736 append data " 4 $a $b $c $d\n" 736 737 append celltypes "10\n" 737 incr count738 incr _numCells 738 739 } 739 740 append out "DATASET UNSTRUCTURED_GRID\n" … … 742 743 append out " $x $y $z\n" 743 744 } 744 append out "CELLS $count [expr $count * 5]\n" 745 set count [expr $_numCells * 5] 746 append out "CELLS $_numCells $count\n" 745 747 append out $data 746 append out "CELL_TYPES $ count\n"748 append out "CELL_TYPES $_numCells\n" 747 749 append out $celltypes 748 750 set _limits(x) [$xv limits] … … 758 760 set _type "hexahedrons" 759 761 set _numPoints [$xv length] 760 set count0762 set _numCells 0 761 763 set data {} 762 764 set celltypes {} … … 764 766 append data " 8 $a $b $c $d $e $f $g $h\n" 765 767 append celltypes "12\n" 766 incr count768 incr _numCells 767 769 } 768 770 append out "DATASET UNSTRUCTURED_GRID\n" … … 771 773 append out " $x $y $z\n" 772 774 } 773 append out "CELLS $count [expr $count * 9]\n" 775 set count [expr $_numCells * 9] 776 append out "CELLS $_numCells $count\n" 774 777 append out $data 775 append out "CELL_TYPES $ count\n"778 append out "CELL_TYPES $_numCells\n" 776 779 append out $celltypes 777 780 set _limits(x) [$xv limits] … … 787 790 set _type "wedges" 788 791 set _numPoints [$xv length] 789 set count0792 set _numCells 0 790 793 set data {} 791 794 set celltypes {} … … 793 796 append data " 6 $a $b $c $d $e $f\n" 794 797 append celltypes "13\n" 795 incr count798 incr _numCells 796 799 } 797 800 append out "DATASET UNSTRUCTURED_GRID\n" … … 800 803 append out " $x $y $z\n" 801 804 } 802 append out "CELLS $count [expr $count * 7]\n" 805 set count [expr $_numCells * 7] 806 append out "CELLS $_numCells $count\n" 803 807 append out $data 804 append out "CELL_TYPES $ count\n"808 append out "CELL_TYPES $_numCells\n" 805 809 append out $celltypes 806 810 set _limits(x) [$xv limits] … … 816 820 set _type "pyramids" 817 821 set _numPoints [$xv length] 818 set count0822 set _numCells 0 819 823 set data {} 820 824 set celltypes {} … … 822 826 append data " 5 $a $b $c $d $e\n" 823 827 append celltypes "14\n" 824 incr count828 incr _numCells 825 829 } 826 830 append out "DATASET UNSTRUCTURED_GRID\n" … … 829 833 append out " $x $y $z\n" 830 834 } 831 append out "CELLS $count [expr $count * 6]\n" 835 set count [expr $_numCells * 6] 836 append out "CELLS $_numCells $count\n" 832 837 append out $data 833 append out "CELL_TYPES $ count\n"838 append out "CELL_TYPES $_numCells\n" 834 839 append out $celltypes 835 840 set _limits(x) [$xv limits]
Note: See TracChangeset
for help on using the changeset viewer.