vedo.grids

unstructured
UnstructuredGrid
Bases: PointAlgorithms, MeshVisual
Support for UnstructuredGrid objects.
Source code in vedo/grids/unstructured.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 | |
actor
property
writable
Return the vtkActor of the object.
cell_types_array
property
Return the list of cell types in the dataset.
bounds()
Get the object bounds.
Returns a list in format [xmin,xmax, ymin,ymax, zmin,zmax].
Source code in vedo/grids/unstructured.py
515 516 517 518 519 520 521 | |
clean()
Cleanup unused points and empty cells
Source code in vedo/grids/unstructured.py
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 | |
clone(deep=True)
Clone the UnstructuredGrid object to yield an exact copy.
Source code in vedo/grids/unstructured.py
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | |
copy(deep=True)
Return a copy of the object. Alias of clone().
Source code in vedo/grids/unstructured.py
492 493 494 | |
cut_with_box(box)
Cut the grid with the specified bounding box.
Parameter box has format [xmin, xmax, ymin, ymax, zmin, zmax]. If an object is passed, its bounding box are used.
This method always returns a TetMesh object.
Examples:
from vedo import *
tmesh = TetMesh(dataurl+'limb_ugrid.vtk')
tmesh.color('rainbow')
cu = Cube(side=500).x(500) # any Mesh works
tmesh.cut_with_box(cu).show(axes=1)

Source code in vedo/grids/unstructured.py
892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 | |
cut_with_mesh(mesh, invert=False, whole_cells=False, on_boundary=False)
Cut a UnstructuredGrid or TetMesh with a Mesh.
Use invert to return cut off part of the input object.
Source code in vedo/grids/unstructured.py
928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 | |
cut_with_plane(origin=(0, 0, 0), normal='x')
Cut the object with the plane defined by a point and a normal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
origin
|
list
|
the cutting plane goes through this point |
(0, 0, 0)
|
normal
|
(list, str)
|
normal vector to the cutting plane |
'x'
|
Source code in vedo/grids/unstructured.py
834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 | |
extract_cells_by_id(idlist, use_point_ids=False)
Return a new UnstructuredGrid composed of the specified subset of indices.
Source code in vedo/grids/unstructured.py
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | |
extract_cells_by_type(ctype)
Extract a specific cell type and return a new UnstructuredGrid.
Source code in vedo/grids/unstructured.py
663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 | |
extract_cells_on_cylinder(center, axis, radius)
Extract cells that are lying of the specified surface.
Source code in vedo/grids/unstructured.py
806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 | |
extract_cells_on_plane(origin, normal)
Extract cells that are lying of the specified surface.
Source code in vedo/grids/unstructured.py
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 | |
extract_cells_on_sphere(center, radius)
Extract cells that are lying of the specified surface.
Source code in vedo/grids/unstructured.py
781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 | |
find_cell(p)
Locate the cell that contains a point and return the cell ID.
Source code in vedo/grids/unstructured.py
727 728 729 730 731 732 733 734 | |
isosurface(value=None, flying_edges=False)
Return an Mesh isosurface extracted from the Volume object.
Set value as single float or list of values to draw the isosurface(s).
Use flying_edges for faster results (but sometimes can interfere with smooth()).
Examples:
Source code in vedo/grids/unstructured.py
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 | |
merge(*others)
Merge multiple datasets into one single UnstrcturedGrid.
Source code in vedo/grids/unstructured.py
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | |
shrink(fraction=0.8)
Shrink the individual cells.

Source code in vedo/grids/unstructured.py
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 | |
threshold(name=None, above=None, below=None, on='cells')
Threshold the tetrahedral mesh by a cell scalar value. Reduce to only cells which satisfy the threshold limits.
- if
above = belowwill only select cells with that specific value. - if
above > belowselection range is flipped.
Set keyword "on" to either "cells" or "points".
Source code in vedo/grids/unstructured.py
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 | |
tomesh(fill=False, shrink=1.0)
Build a polygonal Mesh from the current object.
If fill=True, the interior faces of all the cells are created.
(setting a shrink value slightly smaller than the default 1.0
can avoid flickering due to internal adjacent faces).
If fill=False, only the boundary faces will be generated.
Source code in vedo/grids/unstructured.py
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 | |
tetmesh
TetMesh
Bases: UnstructuredGrid
The class describing tetrahedral meshes.
Source code in vedo/grids/tetmesh.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | |
check_validity(tol=0)
Return an array of possible problematic tets following this convention:
Valid = 0
WrongNumberOfPoints = 01
IntersectingEdges = 02
IntersectingFaces = 04
NoncontiguousEdges = 08
Nonconvex = 10
OrientedIncorrectly = 20
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tol
|
float
|
This value is used as an epsilon for floating point equality checks throughout the cell checking process. |
0
|
Source code in vedo/grids/tetmesh.py
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | |
compute_quality(metric=7)
Calculate functions of quality for the elements of a tetrahedral mesh. This method adds to the mesh a cell array named "Quality".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric
|
int
|
type of estimators: - EDGE RATIO, 0 - ASPECT RATIO, 1 - RADIUS RATIO, 2 - ASPECT FROBENIUS, 3 - MIN_ANGLE, 4 - COLLAPSE RATIO, 5 - ASPECT GAMMA, 6 - VOLUME, 7 |
7
|
See class vtkMeshQuality for an explanation of the meaning of each metric..
Source code in vedo/grids/tetmesh.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | |
decimate(scalars_name, fraction=0.5, n=0)
Downsample the number of tets in a TetMesh to a specified fraction.
Either fraction or n must be set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fraction
|
float
|
the desired final fraction of the total. |
0.5
|
n
|
int
|
the desired number of final tets |
0
|
.. note:: setting fraction=0.1 leaves 10% of the original nr of tets.
Source code in vedo/grids/tetmesh.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | |
generate_random_points(n, min_radius=0)
Generate n uniformly distributed random points
inside the tetrahedral mesh.
A new point data array is added to the output points called "OriginalCellID" which contains the index of the cell ID in which the point was generated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
number of points to generate. |
required |
min_radius
|
float
|
impose a minimum distance between points.
If |
0
|
Returns a vedo.Points object.
Note
Consider using points.probe(msh) to interpolate
any existing mesh data onto the points.
Examples:
from vedo import *
tmesh = TetMesh(dataurl + "limb.vtu").alpha(0.2)
pts = tmesh.generate_random_points(20000, min_radius=10)
print(pts.pointdata["OriginalCellID"])
show(pts, tmesh, axes=1).close()
Source code in vedo/grids/tetmesh.py
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | |
isosurface(value=True, flying_edges=None)
Return a vedo.Mesh isosurface.
The "isosurface" is the surface of the region of points
whose values equal to value.
Set value to a single value or list of values to compute the isosurface(s).
Note that flying_edges option is not available for TetMesh.
Source code in vedo/grids/tetmesh.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | |
slice(origin=(0, 0, 0), normal=(1, 0, 0))
Return a 2D slice of the mesh by a plane passing through origin and assigned normal.
Source code in vedo/grids/tetmesh.py
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | |
subdivide()
Increase the number of tetrahedrons of a TetMesh.
Subdivides each tetrahedron into twelve smaller tetras.
Source code in vedo/grids/tetmesh.py
383 384 385 386 387 388 389 390 391 392 393 | |
rectilinear
RectilinearGrid
Bases: PointAlgorithms, MeshVisual
Build a rectilinear grid.
Source code in vedo/grids/rectilinear.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 | |
actor
property
writable
Return the vtkActor of the object.
bounds()
Get the object bounds.
Returns a list in format [xmin,xmax, ymin,ymax, zmin,zmax].
Source code in vedo/grids/rectilinear.py
394 395 396 397 398 399 400 | |
clone(deep=True)
Return a clone copy of the RectilinearGrid. Alias of copy().
Source code in vedo/grids/rectilinear.py
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | |
compute_cellid(ijk)
Given a location in structured coordinates (i-j-k), return the cell id.
Source code in vedo/grids/rectilinear.py
350 351 352 | |
compute_pointid(ijk)
Given a location in structured coordinates (i-j-k), return the point id.
Source code in vedo/grids/rectilinear.py
346 347 348 | |
compute_structured_coords(x)
Convenience function computes the structured coordinates for a point x.
This method returns a dictionary with keys ijk, pcoords and inside.
The cell is specified by the array ijk.
and the parametric coordinates in the cell are specified with pcoords.
Value of inside is False if the point x is outside of the grid.
Source code in vedo/grids/rectilinear.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | |
cut_with_mesh(mesh, invert=False, whole_cells=False, on_boundary=False)
Cut a RectilinearGrid with a Mesh.
Use invert to return cut off part of the input object.
Source code in vedo/grids/rectilinear.py
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 | |
cut_with_plane(origin=(0, 0, 0), normal='x')
Cut the object with the plane defined by a point and a normal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
origin
|
list
|
the cutting plane goes through this point |
(0, 0, 0)
|
normal
|
(list, str)
|
normal vector to the cutting plane |
'x'
|
Source code in vedo/grids/rectilinear.py
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 | |
dimensions()
Return the number of points in the x, y and z directions.
Source code in vedo/grids/rectilinear.py
296 297 298 | |
find_cell(x)
Given a position x, return the id of the closest cell.
Source code in vedo/grids/rectilinear.py
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
find_point(x)
Given a position x, return the id of the closest point.
Source code in vedo/grids/rectilinear.py
354 355 356 | |
has_blank_cells()
Return True if the grid has blank cells.
Source code in vedo/grids/rectilinear.py
324 325 326 | |
has_blank_points()
Return True if the grid has blank points.
Source code in vedo/grids/rectilinear.py
320 321 322 | |
is_cell_visible(cid)
Return True if cell cid is visible.
Source code in vedo/grids/rectilinear.py
316 317 318 | |
is_point_visible(pid)
Return True if point pid is visible.
Source code in vedo/grids/rectilinear.py
312 313 314 | |
isosurface(value=None)
Return a Mesh isosurface extracted from the object.
Set value as single float or list of values to draw the isosurface(s).
Source code in vedo/grids/rectilinear.py
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | |
x_coordinates()
Return the x-coordinates of the grid.
Source code in vedo/grids/rectilinear.py
300 301 302 | |
y_coordinates()
Return the y-coordinates of the grid.
Source code in vedo/grids/rectilinear.py
304 305 306 | |
z_coordinates()
Return the z-coordinates of the grid.
Source code in vedo/grids/rectilinear.py
308 309 310 | |
structured
StructuredGrid
Bases: PointAlgorithms, MeshVisual
Build a structured grid.
Source code in vedo/grids/structured.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | |
actor
property
writable
Return the vtkActor of the object.
clone(deep=True)
Return a clone copy of the StructuredGrid. Alias of copy().
Source code in vedo/grids/structured.py
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
cut_with_mesh(mesh, invert=False, whole_cells=False, on_boundary=False)
Cut a RectilinearGrid with a Mesh.
Use invert to return cut off part of the input object.
Returns an UnstructuredGrid object.
Source code in vedo/grids/structured.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 | |
cut_with_plane(origin=(0, 0, 0), normal='x')
Cut the object with the plane defined by a point and a normal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
origin
|
list
|
the cutting plane goes through this point |
(0, 0, 0)
|
normal
|
(list, str)
|
normal vector to the cutting plane |
'x'
|
Returns an UnstructuredGrid object.
Source code in vedo/grids/structured.py
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
dimensions()
Return the number of points in the x, y and z directions.
Source code in vedo/grids/structured.py
310 311 312 313 314 315 316 317 | |
find_cell(x)
Given a position x, return the id of the closest cell.
Source code in vedo/grids/structured.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | |
find_point(x)
Given a position x, return the id of the closest point.
Source code in vedo/grids/structured.py
338 339 340 | |
isosurface(value=None)
Return a Mesh isosurface extracted from the object.
Set value as single float or list of values to draw the isosurface(s).
Source code in vedo/grids/structured.py
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | |
explicit
ExplicitStructuredGrid
Build an explicit structured grid.
An explicit structured grid is a dataset where edges of the hexahedrons are
not necessarily parallel to the coordinate axes.
It can be thought of as a tessellation of a block of 3D space,
similar to a RectilinearGrid
except that the cells are not necessarily cubes, they can have different
orientations but are connected in the same way as a RectilinearGrid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputobj
|
(vtkExplicitStructuredGrid, list, str)
|
list of points and indices, or filename |
None
|
Source code in vedo/grids/explicit.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | |
actor
property
writable
Return the vtkActor of the object.
blank_cell(cell_id)
Blank cell cell_id.
Source code in vedo/grids/explicit.py
374 375 376 377 | |
build_links()
Build topological links from points to the cells that use them.
Source code in vedo/grids/explicit.py
273 274 275 276 | |
cell_bounds(cell_id)
Return the bounds of cell cell_id.
Source code in vedo/grids/explicit.py
389 390 391 392 393 | |
cell_dimensions()
Return the number of cells in the x, y and z directions.
Source code in vedo/grids/explicit.py
243 244 245 246 247 | |
cell_neighbors(cell_id, pt_ids=None, whole_extent=None)
Return the neighbors of cell cell_id.
If pt_ids is given, return the ids of the cells sharing all those points.
Otherwise return the six face-neighbor ids.
Source code in vedo/grids/explicit.py
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
cell_points(cell_id)
Return the point ids that define cell cell_id.
Source code in vedo/grids/explicit.py
278 279 280 281 282 283 284 | |
cell_size(cell_id)
Return the number of points used by cell cell_id.
Source code in vedo/grids/explicit.py
399 400 401 | |
cell_type(cell_id)
Return the VTK cell type id of cell cell_id.
Source code in vedo/grids/explicit.py
395 396 397 | |
check_and_reorder_faces()
Check and reorder cell faces to match the structured orientation.
Source code in vedo/grids/explicit.py
384 385 386 387 | |
clone(deep=True)
Return a clone copy of the StructuredGrid. Alias of copy().
Source code in vedo/grids/explicit.py
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | |
compute_cell_structured_coords(cell_id, adjust_for_extent=True)
Return the structured (i, j, k) coordinates of cell cell_id.
Source code in vedo/grids/explicit.py
323 324 325 326 327 328 329 330 331 332 333 | |
compute_cellid(ijk, adjust_for_extent=True)
Return the cell id for the structured coordinates (i, j, k).
Source code in vedo/grids/explicit.py
335 336 337 338 339 340 341 342 343 | |
compute_faces_connectivity_flags_array()
Compute the faces connectivity flags array.
Source code in vedo/grids/explicit.py
345 346 347 348 | |
cut_with_plane(origin=(0, 0, 0), normal='x')
Cut the object with the plane defined by a point and a normal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
origin
|
list
|
the cutting plane goes through this point |
(0, 0, 0)
|
normal
|
(list, str)
|
normal vector to the cutting plane |
'x'
|
Returns an UnstructuredGrid object.
Source code in vedo/grids/explicit.py
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | |
data_dimension()
Return the dimensionality of the data.
Source code in vedo/grids/explicit.py
239 240 241 | |
dimensions()
Return the number of points in the x, y and z directions.
Source code in vedo/grids/explicit.py
230 231 232 233 234 235 236 237 | |
extent()
Return the structured grid extent.
Source code in vedo/grids/explicit.py
249 250 251 | |
extent_type()
Return the extent type identifier.
Source code in vedo/grids/explicit.py
253 254 255 | |
find_point(x)
Given a position x, return the id of the closest point.
Source code in vedo/grids/explicit.py
419 420 421 | |
has_blank_cells()
Return True if the grid has blank cells.
Source code in vedo/grids/explicit.py
354 355 356 | |
has_blank_points()
Return True if the grid has blank points.
Source code in vedo/grids/explicit.py
350 351 352 | |
has_ghost_cells()
Return True if the grid has ghost cells.
Source code in vedo/grids/explicit.py
366 367 368 | |
has_ghost_points()
Return True if the grid has ghost points.
Source code in vedo/grids/explicit.py
370 371 372 | |
is_cell_ghost(cell_id)
Return True if cell cell_id is marked as ghost.
Source code in vedo/grids/explicit.py
362 363 364 | |
is_cell_visible(cell_id)
Return True if cell cell_id is visible.
Source code in vedo/grids/explicit.py
358 359 360 | |
max_cell_size()
Return the maximum cell size.
Source code in vedo/grids/explicit.py
407 408 409 | |
max_spatial_dimension()
Return the maximum spatial dimension across all cells.
Source code in vedo/grids/explicit.py
411 412 413 | |
min_spatial_dimension()
Return the minimum spatial dimension across all cells.
Source code in vedo/grids/explicit.py
415 416 417 | |
number_of_cells()
Return the number of cells.
Source code in vedo/grids/explicit.py
403 404 405 | |
point_cells(point_id)
Return the cell ids that use point point_id.
Source code in vedo/grids/explicit.py
286 287 288 289 290 291 292 | |
print()
Print object info.
Source code in vedo/grids/explicit.py
157 158 159 160 | |
set_dimensions(*dims)
Set the grid dimensions as number of points along x, y and z.
Source code in vedo/grids/explicit.py
257 258 259 260 261 262 263 | |
set_extent(*extent)
Set the structured grid extent.
Source code in vedo/grids/explicit.py
265 266 267 268 269 270 271 | |
unblank_cell(cell_id)
Unblank cell cell_id.
Source code in vedo/grids/explicit.py
379 380 381 382 | |
