vedo.addons

core
Goniometer(p1, p2, p3, font='', arc_size=0.4, s=1, italic=0, rotation=0, prefix='', lc='k2', c='white', alpha=1, lw=2, precision=3)
Build a graphical goniometer to measure the angle formed by 3 points in space.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p1
|
list
|
First point 3D coordinates. |
required |
p2
|
list
|
The vertex point. |
required |
p3
|
list
|
The last point defining the angle. |
required |
font
|
str
|
Font face. Check available fonts here. |
''
|
arc_size
|
float
|
Dimension of the arc relative to the smallest axis. |
0.4
|
s
|
float
|
Size of the text. |
1
|
italic
|
float | bool
|
Whether to render italic text. |
0
|
rotation
|
float
|
Rotation of the text in degrees. |
0
|
prefix
|
str
|
String appended to the numeric value of the angle. |
''
|
lc
|
list
|
Color of the goniometer lines. |
'k2'
|
c
|
str
|
Color of the goniometer angle filling. Set |
'white'
|
alpha
|
float
|
Transparency level. |
1
|
lw
|
float
|
Line width. |
2
|
precision
|
int
|
Number of significant digits. |
3
|
Examples:
Source code in vedo/addons/core.py
23 24 25 26 27 28 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 | |
Light(pos, focal_point=(0, 0, 0), angle=180, c=None, intensity=1)
Generate a source of light placed at pos and directed to focal point.
Returns a vtkLight object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pos
|
list | vedo object
|
Light position, or a |
required |
focal_point
|
list
|
Focal point. If a |
(0, 0, 0)
|
angle
|
float
|
Aperture angle of the light source in degrees. |
180
|
c
|
color
|
Light color. |
None
|
intensity
|
float
|
Intensity value between 0 and 1. |
1
|
Check also
plotter.Plotter.remove_lights()
Examples:
Source code in vedo/addons/core.py
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 | |
ScalarBar(obj, title='', pos=(), size=(80, 400), font_size=14, title_yoffset=20, nlabels=None, c='k', horizontal=False, use_alpha=True, label_format=':6.3g')
A 2D scalar bar for the specified object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
Input object or scalar range used to derive the lookup table. |
required | |
title
|
str
|
Scalar bar title. |
''
|
pos
|
list
|
Bottom-left position. It can also be a pair of normalized |
()
|
size
|
tuple[float, float]
|
Scalar bar size in pixels as |
(80, 400)
|
font_size
|
float
|
Font size for title and numeric labels. |
14
|
title_yoffset
|
float
|
Vertical space offset between title and color bar. |
20
|
nlabels
|
int
|
Number of numeric labels. |
None
|
c
|
list
|
Text color. |
'k'
|
horizontal
|
bool
|
Lay the scalar bar out horizontally. |
False
|
use_alpha
|
bool
|
Render transparency in the color bar itself. |
True
|
label_format
|
str
|
C-style format string for numeric labels. |
':6.3g'
|
Examples:

Source code in vedo/addons/core.py
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 | |
ScalarBar3D(obj, title='', pos=None, size=(0, 0), title_font='', title_xoffset=-1.2, title_yoffset=0.0, title_size=1.5, title_rotation=0.0, nlabels=8, label_font='', label_size=1, label_offset=0.375, label_rotation=0, label_format='', italic=0, c='k', draw_box=True, above_text=None, below_text=None, nan_text='NaN', categories=None)
Create a 3D scalar bar for the specified object.
Input obj input can be:
- a look-up-table,
- a Mesh already containing a set of scalars associated to vertices or cells,
- if None the last object in the list of actors will be used.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
list
|
(thickness, length) of scalarbar |
(0, 0)
|
title
|
str
|
scalar bar title |
''
|
title_xoffset
|
float
|
horizontal space btw title and color scalarbar |
-1.2
|
title_yoffset
|
float
|
vertical space offset |
0.0
|
title_size
|
float
|
size of title wrt numeric labels |
1.5
|
title_rotation
|
float
|
title rotation in degrees |
0.0
|
nlabels
|
int
|
number of numeric labels |
8
|
label_font
|
str
|
font type for labels |
''
|
label_size
|
float
|
label scale factor |
1
|
label_offset
|
float
|
space btw numeric labels and scale |
0.375
|
label_rotation
|
float
|
label rotation in degrees |
0
|
draw_box
|
bool
|
draw a box around the colorbar |
True
|
categories
|
list
|
make a categorical scalarbar, the input list will have the format [value, color, alpha, textlabel] |
None
|
Examples:
Source code in vedo/addons/core.py
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 | |
axes
Axes(obj=None, xtitle='x', ytitle='y', ztitle='z', xrange=None, yrange=None, zrange=None, c=None, number_of_divisions=None, digits=None, limit_ratio=0.04, title_depth=0, title_font='', text_scale=1.0, x_values_and_labels=None, y_values_and_labels=None, z_values_and_labels=None, htitle='', htitle_size=0.03, htitle_font=None, htitle_italic=False, htitle_color=None, htitle_backface_color=None, htitle_justify='bottom-left', htitle_rotation=0, htitle_offset=(0, 0.01, 0), xtitle_position=0.95, ytitle_position=0.95, ztitle_position=0.95, xtitle_offset=0.025, ytitle_offset=0.0275, ztitle_offset=0.02, xtitle_justify=None, ytitle_justify=None, ztitle_justify=None, xtitle_rotation=0, ytitle_rotation=0, ztitle_rotation=0, xtitle_box=False, ytitle_box=False, xtitle_size=0.025, ytitle_size=0.025, ztitle_size=0.025, xtitle_color=None, ytitle_color=None, ztitle_color=None, xtitle_backface_color=None, ytitle_backface_color=None, ztitle_backface_color=None, xtitle_italic=0, ytitle_italic=0, ztitle_italic=0, grid_linewidth=1, xygrid=True, yzgrid=False, zxgrid=False, xygrid2=False, yzgrid2=False, zxgrid2=False, xygrid_transparent=False, yzgrid_transparent=False, zxgrid_transparent=False, xygrid2_transparent=False, yzgrid2_transparent=False, zxgrid2_transparent=False, xyplane_color=None, yzplane_color=None, zxplane_color=None, xygrid_color=None, yzgrid_color=None, zxgrid_color=None, xyalpha=0.075, yzalpha=0.075, zxalpha=0.075, xyframe_line=None, yzframe_line=None, zxframe_line=None, xyframe_color=None, yzframe_color=None, zxframe_color=None, axes_linewidth=1, xline_color=None, yline_color=None, zline_color=None, xhighlight_zero=False, yhighlight_zero=False, zhighlight_zero=False, xhighlight_zero_color='red4', yhighlight_zero_color='green4', zhighlight_zero_color='blue4', show_ticks=True, xtick_length=0.015, ytick_length=0.015, ztick_length=0.015, xtick_thickness=0.0025, ytick_thickness=0.0025, ztick_thickness=0.0025, xminor_ticks=1, yminor_ticks=1, zminor_ticks=1, tip_size=None, label_font='', xlabel_color=None, ylabel_color=None, zlabel_color=None, xlabel_backface_color=None, ylabel_backface_color=None, zlabel_backface_color=None, xlabel_size=0.016, ylabel_size=0.016, zlabel_size=0.016, xlabel_offset=0.8, ylabel_offset=0.8, zlabel_offset=0.8, xlabel_justify=None, ylabel_justify=None, zlabel_justify=None, xlabel_rotation=0, ylabel_rotation=0, zlabel_rotation=0, xaxis_rotation=0, yaxis_rotation=0, zaxis_rotation=0, xyshift=0, yzshift=0, zxshift=0, xshift_along_y=0, xshift_along_z=0, yshift_along_x=0, yshift_along_z=0, zshift_along_x=0, zshift_along_y=0, x_use_bounds=True, y_use_bounds=True, z_use_bounds=False, x_inverted=False, y_inverted=False, z_inverted=False, use_global=False, tol=0.001)
Draw axes for the input object. Check available fonts here.
Returns an vedo.Assembly object.
Parameters
xtitle, ['x'], x-axis title textxrange, [None], x-axis range in format (xmin, ymin), default is automatic.number_of_divisions, [None], approximate number of divisions on the longest axisaxes_linewidth, [1], width of the axes linesgrid_linewidth, [1], width of the grid linestitle_depth, [0], extrusion fractional depth of title textx_values_and_labels[], assign custom tick positions and labels [(pos1, label1), ...]xygrid, [True], show a gridded wall on plane xyyzgrid, [True], show a gridded wall on plane yzzxgrid, [True], show a gridded wall on plane zxyzgrid2, [False], show yz plane on opposite side of the bounding boxzxgrid2, [False], show zx plane on opposite side of the bounding boxxygrid_transparent[False], make grid plane completely transparentxygrid2_transparent[False], make grid plane completely transparent on opposite side boxxyplane_color, ['None'], color of the planexygrid_color, ['None'], grid line colorxyalpha, [0.15], grid plane opacityxyframe_line, [0], add a frame for the plane, use value as the thicknessxyframe_color, [None], color for the frame of the planeshow_ticks, [True], show major ticksdigits, [None], use this number of significant digits in scientific notationtitle_font, [''], font for axes titleslabel_font, [''], font for numeric labelstext_scale, [1.0], global scaling factor for all text elements (titles, labels)htitle, [''], header titlehtitle_size, [0.03], header title sizehtitle_font, [None], header font (defaults totitle_font)htitle_italic, [True], header font is italichtitle_color, [None], header title color (defaults toxtitle_color)htitle_backface_color, [None], header title color on its backfacehtitle_justify, ['bottom-center'], origin of the title justificationhtitle_offset, [(0,0.01,0)], control offsets of header title in x, y and zxtitle_position, [0.32], title fractional positions along axisxtitle_offset, [0.05], title fractional offset distance from axis line, can be a listxtitle_justify, [None], choose the origin of the bounding box of titlextitle_rotation, [0], add a rotation of the axis title, can be a list (rx,ry,rz)xtitle_box, [False], add a box around title textxline_color, [automatic], color of the x-axisxtitle_color, [automatic], color of the axis titlextitle_backface_color, [None], color of axis title on its backfacextitle_size, [0.025], size of the axis titlextitle_italic, [0], a bool or float to make the font italicxhighlight_zero, [True], draw a line highlighting zero position if in rangexhighlight_zero_color, [auto], color of the line highlighting the zero positionxtick_length, [0.005], radius of the major ticksxtick_thickness, [0.0025], thickness of the major ticks along their axisxminor_ticks, [1], number of minor ticks between two major ticksxlabel_color, [automatic], color of numeric labels and ticksxlabel_backface_color, [auto], back face color of numeric labels and ticksxlabel_size, [0.015], size of the numeric labels along axisxlabel_rotation, [0,list], numeric labels rotation (can be a list of 3 rotations)xlabel_offset, [0.8,list], offset of the numeric labels (can be a list of 3 offsets)xlabel_justify, [None], choose the origin of the bounding box of labelsxaxis_rotation, [0], rotate the X axis elements (ticks and labels) around this same axisxyshift[0.0], slide the xy-plane along z (the range is [0,1])xshift_along_y[0.0], slide x-axis along the y-axis (the range is [0,1])tip_size, [0.01], size of the arrow tip as a fraction of the bounding box diagonallimit_ratio, [0.04], below this ratio don't plot smaller axisx_use_bounds, [True], keep into account space occupied by labels when setting camerax_inverted, [False], invert labels order and direction (only visually!)use_global, [False], try to compute the global bounding box of visible actors
Examples:
from vedo import Axes, Box, show
box = Box(pos=(1,2,3), size=(8,9,7)).alpha(0.1)
axs = Axes(box, c='k') # returns an Assembly object
for a in axs.unpack():
print(a.name)
show(box, axs).close()
Examples:

Source code in vedo/addons/axes.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 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 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 | |
add_global_axes(axtype=None, c=None, bounds=())
Draw axes on scene. Available axes types are
Parameters
axtype (int):
- 0, no axes,
- 1, draw three gray grid walls
- 2, show cartesian axes from (0,0,0)
- 3, show positive range of cartesian axes from (0,0,0)
- 4, show a triad at bottom left
- 5, show a cube at bottom left
- 6, mark the corners of the bounding box
- 7, draw a 3D ruler at each side of the cartesian axes
- 8, show the vtkCubeAxesActor object
- 9, show the bounding box outLine
- 10, show three circles representing the maximum bounding box
- 11, show a large grid on the x-y plane (use with zoom=8)
- 12, show polar axes
- 13, draw a simple ruler at the bottom of the window
- 14, show the vtk default vtkCameraOrientationWidget object
Axis type-1 can be fully customized by passing a dictionary axes=dict(),
see vedo.Axes for the complete list of options.
Examples:
from vedo import Box, show
b = Box(pos=(0, 0, 0), size=(80, 90, 70)).alpha(0.1)
show(
b,
axes={
"xtitle": "Some long variable [a.u.]",
"number_of_divisions": 4,
# ...
},
)
Source code in vedo/addons/axes.py
1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 | |
widgets
Button
Bases: Text2D
Build a Button object to be shown in the rendering window.
Source code in vedo/addons/widgets.py
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 | |
status(s=None)
Set/Get the status of the button.
Source code in vedo/addons/widgets.py
203 204 205 206 207 208 209 210 211 212 213 214 215 | |
switch()
Change/cycle button status to the next defined status in states list.
Source code in vedo/addons/widgets.py
217 218 219 220 221 | |
ButtonWidget
Create a button widget.
Source code in vedo/addons/widgets.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 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 | |
state
property
writable
Return the current state.
disable()
Disable the button widget.
Source code in vedo/addons/widgets.py
132 133 134 135 | |
enable()
Enable the button widget.
Source code in vedo/addons/widgets.py
127 128 129 130 | |
next_state()
Change to the next state.
Source code in vedo/addons/widgets.py
137 138 139 140 | |
pos(pos)
Set the position of the button widget.
Source code in vedo/addons/widgets.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
DrawingWidget
3D widget for tracing on planar props.
Source code in vedo/addons/widgets.py
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 | |
interactor
property
writable
Return the interactor for the widget.
renderer
property
writable
Return the renderer for the widget.
add_observer(event, func, priority=1)
Add an observer to the widget.
Source code in vedo/addons/widgets.py
267 268 269 270 271 | |
callback(widget, _event_name)
Callback function for the widget.
Source code in vedo/addons/widgets.py
261 262 263 264 265 | |
freeze(value=True)
Freeze the widget by disabling interaction.
Source code in vedo/addons/widgets.py
305 306 307 308 | |
off()
Disactivate/Disable the widget.
Source code in vedo/addons/widgets.py
300 301 302 303 | |
on()
Activate/Enable the widget.
Source code in vedo/addons/widgets.py
293 294 295 296 297 298 | |
remove()
Remove the widget.
Source code in vedo/addons/widgets.py
310 311 312 313 314 315 316 317 318 | |
interaction
CylinderWidget
An interactive widget to place and resize a 3D cylinder.
The cylinder axis, center, and radius can be manipulated interactively.
Use add_to(plotter) to activate the widget in a scene.
Read back center, radius, axis, and points in an observer callback.
Example
from vedo import Plotter, UnstructuredGrid, dataurl
from vedo.addons import CylinderWidget
def on_move(widget, event):
print(cw.center, cw.radius, cw.axis)
domain = UnstructuredGrid(dataurl + "comb_domain.vtu")
plt = Plotter()
cw = CylinderWidget((5, 0, 30), domain, r=2, axis=(0, 0, 1))
cw.add_to(plt)
cw.add_observer("interaction", on_move)
plt.show().close()
Source code in vedo/addons/interaction.py
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 | |
axis
property
writable
Unit vector along the cylinder axis.
center
property
writable
World position of the cylinder center.
length
property
Cylinder length derived from the widget placement bounds.
points
property
Return surface points of the cylinder as a (N, 3) array.
Points are sampled with res circumferential divisions and 2 rows
(top/bottom caps), derived analytically from center, axis, and radius.
radius
property
writable
Radius of the cylinder.
add_observer(event, func, priority=1)
Add an observer callback for a widget event.
Source code in vedo/addons/interaction.py
934 935 936 937 | |
add_to(plt)
Add the widget to a Plotter instance and enable it.
Source code in vedo/addons/interaction.py
894 895 896 897 898 899 900 901 | |
alpha(value)
Set the cylinder surface opacity.
Source code in vedo/addons/interaction.py
887 888 889 890 | |
color(c)
Set the cylinder surface color.
Source code in vedo/addons/interaction.py
882 883 884 885 | |
is_enabled()
Return True if the widget is currently enabled.
Source code in vedo/addons/interaction.py
928 929 930 | |
off()
Disable the widget.
Source code in vedo/addons/interaction.py
915 916 917 918 | |
on()
Enable the widget.
Source code in vedo/addons/interaction.py
910 911 912 913 | |
remove_from(plt)
Remove the widget from a Plotter instance.
Source code in vedo/addons/interaction.py
903 904 905 906 907 908 | |
remove_observer(cid)
Remove an observer by its callback id.
Source code in vedo/addons/interaction.py
939 940 941 942 | |
remove_observers(event='')
Remove all observers, or those for a specific event.
Source code in vedo/addons/interaction.py
944 945 946 947 948 949 950 | |
toggle()
Toggle the widget on/off.
Source code in vedo/addons/interaction.py
920 921 922 923 924 925 926 | |
LineWidget
An interactive widget to place and manipulate a 3D line segment.
Two draggable sphere handles mark the endpoints. The line can be translated, scaled, and its endpoints repositioned interactively.
Use add_to(plotter) to activate the widget in a scene.
Read back p1/p2 inside an observer callback to get updated positions.
Example
from vedo import Plotter, Sphere
from vedo.addons import LineWidget
def on_move(widget, event):
print(widget.p1, "->", widget.p2, " length:", round(widget.length, 3))
plt = Plotter()
plt += Sphere().alpha(0.3)
lw = LineWidget((-0.5, 0, 0), (0.5, 0, 0))
lw.add_to(plt)
lw.add_observer("interaction", on_move)
plt.show().close()
Source code in vedo/addons/interaction.py
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 | |
direction
property
Unit vector from p1 to p2. Returns zeros if the two points coincide.
length
property
Length of the line segment.
midpoint
property
Midpoint of the line segment.
p1
property
writable
World position of the first endpoint.
p2
property
writable
World position of the second endpoint.
points
property
Return res equally-spaced points along the line segment as a (res, 3)
numpy array. res is the value set at construction time.
add_observer(event, func, priority=1)
Add an observer callback to the widget.
The callback receives (widget, event_name) and can read
widget.p1, widget.p2, widget.length, etc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
str
|
event name, e.g. |
required |
func
|
callable
|
callback function. |
required |
priority
|
int
|
observer priority. |
1
|
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
observer id (use with |
Source code in vedo/addons/interaction.py
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | |
add_to(plt)
Add the widget to a Plotter instance and enable it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plt
|
Plotter
|
the target plotter. |
required |
Source code in vedo/addons/interaction.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | |
get_line()
Return the current widget state as a vedo.Line object.
Useful for extracting geometry after interaction.
Source code in vedo/addons/interaction.py
359 360 361 362 363 364 365 366 367 | |
handle_color(c)
Set the color of both endpoint handles.
Source code in vedo/addons/interaction.py
239 240 241 242 243 244 | |
is_enabled()
Return True if the widget is currently enabled.
Source code in vedo/addons/interaction.py
320 321 322 | |
line_color(c)
Set the color of the line.
Source code in vedo/addons/interaction.py
234 235 236 237 | |
lw(value)
Set the line width in pixels.
Source code in vedo/addons/interaction.py
246 247 248 249 | |
off()
Disable the widget.
Source code in vedo/addons/interaction.py
307 308 309 310 | |
on()
Enable the widget.
Source code in vedo/addons/interaction.py
302 303 304 305 | |
ps(value)
Set the handle sphere size in pixels.
Source code in vedo/addons/interaction.py
251 252 253 254 | |
remove_from(plt)
Remove the widget from a Plotter instance.
Source code in vedo/addons/interaction.py
295 296 297 298 299 300 | |
remove_observer(cid)
Remove a specific observer by its id.
Source code in vedo/addons/interaction.py
344 345 346 347 | |
remove_observers(event='')
Remove all observers, or only those for a specific event.
Source code in vedo/addons/interaction.py
349 350 351 352 353 354 355 | |
show_distance(value=True, fmt='{:.3g}')
Show or hide the distance annotation along the line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
bool
|
whether to show the annotation. |
True
|
fmt
|
str
|
Python format string used for the numeric label. |
'{:.3g}'
|
Source code in vedo/addons/interaction.py
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
toggle()
Toggle the widget on/off.
Source code in vedo/addons/interaction.py
312 313 314 315 316 317 318 | |
PointCloudWidget
Point cloud widget to interactively add or remove points in a point cloud.
Source code in vedo/addons/interaction.py
19 20 21 22 23 24 25 26 27 28 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 | |
interactor
property
writable
Return the current interactor.
renderer
property
writable
Return the current renderer.
add_observer(event, func, priority=1)
Add an observer to the widget.
Source code in vedo/addons/interaction.py
79 80 81 82 83 | |
add_to(plotter)
Add the point cloud widget to a Plotter instance.
Source code in vedo/addons/interaction.py
35 36 37 38 39 40 41 42 43 | |
get_point_coordinates()
Get the coordinates of a point by its index.
Source code in vedo/addons/interaction.py
85 86 87 88 89 | |
off()
Disactivate/Disable the point cloud widget.
Source code in vedo/addons/interaction.py
51 52 53 54 55 | |
on()
Activate/Enable the point cloud widget.
Source code in vedo/addons/interaction.py
45 46 47 48 49 | |
PointWidget
An interactive widget to place a single draggable 3D point.
Use add_to(plotter) to activate the widget in a scene.
Read back pos inside an observer callback to get the current position.
Example
from vedo import Plotter, Sphere
from vedo.addons import PointWidget
def on_move(widget, event):
print(widget.pos)
plt = Plotter()
plt += Sphere().alpha(0.3)
pw = PointWidget((0.5, 0, 0))
pw.add_to(plt)
pw.add_observer("interaction", on_move)
plt.show().close()
Source code in vedo/addons/interaction.py
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 | |
pos
property
writable
World position of the point.
add_observer(event, func, priority=1)
Add an observer callback for a widget event.
Source code in vedo/addons/interaction.py
501 502 503 504 | |
add_to(plt)
Add the widget to a Plotter instance and enable it.
Source code in vedo/addons/interaction.py
460 461 462 463 464 465 466 467 468 | |
alpha(value)
Set the point opacity.
Source code in vedo/addons/interaction.py
448 449 450 451 | |
color(c)
Set the point color.
Source code in vedo/addons/interaction.py
443 444 445 446 | |
is_enabled()
Return True if the widget is currently enabled.
Source code in vedo/addons/interaction.py
495 496 497 | |
off()
Disable the widget.
Source code in vedo/addons/interaction.py
482 483 484 485 | |
on()
Enable the widget.
Source code in vedo/addons/interaction.py
477 478 479 480 | |
ps(value)
Set the sphere radius of the point handle.
Source code in vedo/addons/interaction.py
453 454 455 456 | |
remove_from(plt)
Remove the widget from a Plotter instance.
Source code in vedo/addons/interaction.py
470 471 472 473 474 475 | |
remove_observer(cid)
Remove an observer by its callback id.
Source code in vedo/addons/interaction.py
506 507 508 509 | |
remove_observers(event='')
Remove all observers, or those for a specific event.
Source code in vedo/addons/interaction.py
511 512 513 514 515 516 517 | |
toggle()
Toggle the widget on/off.
Source code in vedo/addons/interaction.py
487 488 489 490 491 492 493 | |
SphereWidget
An interactive widget to place and resize a 3D sphere.
A draggable handle on the sphere surface lets you resize interactively. The sphere body can be translated by clicking and dragging.
Use add_to(plotter) to activate the widget in a scene.
Read back center and radius inside an observer callback.
Example
from vedo import Plotter
from vedo.addons import SphereWidget
def on_move(widget, event):
print(widget.center, widget.radius)
plt = Plotter()
sw = SphereWidget(center=(0, 0, 0), r=1)
sw.add_to(plt)
sw.add_observer("interaction", on_move)
plt.show().close()
Source code in vedo/addons/interaction.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 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 | |
center
property
writable
World position of the sphere center.
points
property
Return the surface point coordinates of the sphere as a (N, 3) array.
N is determined by the res value set at construction time.
Useful as seed points for streamline integration.
radius
property
writable
Radius of the sphere.
add_observer(event, func, priority=1)
Add an observer callback for a widget event.
Source code in vedo/addons/interaction.py
692 693 694 695 | |
add_to(plt)
Add the widget to a Plotter instance and enable it.
Source code in vedo/addons/interaction.py
647 648 649 650 651 652 653 654 655 656 657 658 659 | |
alpha(value)
Set the sphere surface opacity.
Source code in vedo/addons/interaction.py
635 636 637 638 | |
color(c)
Set the sphere surface color.
Source code in vedo/addons/interaction.py
630 631 632 633 | |
get_sphere()
Return the current sphere as a vedo.Sphere object.
Source code in vedo/addons/interaction.py
712 713 714 | |
is_enabled()
Return True if the widget is currently enabled.
Source code in vedo/addons/interaction.py
686 687 688 | |
lw(value)
Set the wireframe line width (when in wireframe mode).
Source code in vedo/addons/interaction.py
640 641 642 643 | |
off()
Disable the widget.
Source code in vedo/addons/interaction.py
673 674 675 676 | |
on()
Enable the widget.
Source code in vedo/addons/interaction.py
668 669 670 671 | |
remove_from(plt)
Remove the widget from a Plotter instance.
Source code in vedo/addons/interaction.py
661 662 663 664 665 666 | |
remove_observer(cid)
Remove an observer by its callback id.
Source code in vedo/addons/interaction.py
697 698 699 700 | |
remove_observers(event='')
Remove all observers, or those for a specific event.
Source code in vedo/addons/interaction.py
702 703 704 705 706 707 708 | |
toggle()
Toggle the widget on/off.
Source code in vedo/addons/interaction.py
678 679 680 681 682 683 684 | |
SplineTool
Bases: vtkContourWidget
Spline tool, draw a spline through a set of points interactively.
Source code in vedo/addons/interaction.py
959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 | |
interactor
property
writable
Return the current interactor.
add_node(pt)
Add one point at a specified position in world/display coordinates.
Source code in vedo/addons/interaction.py
1016 1017 1018 1019 1020 1021 1022 | |
add_observer(event, func, priority=1)
Add an observer to the widget.
Source code in vedo/addons/interaction.py
1024 1025 1026 1027 1028 | |
closed_loop(value)
Set whether the spline is a closed loop.
Source code in vedo/addons/interaction.py
1082 1083 1084 1085 1086 | |
color(c)
Set the color of the spline.
Source code in vedo/addons/interaction.py
1074 1075 1076 1077 1078 1079 1080 | |
lw(lw)
Set the line width of the spline.
Source code in vedo/addons/interaction.py
1057 1058 1059 1060 1061 | |
node_position(i, pt, onscreen=False)
Set the position of a specific node by index.
Source code in vedo/addons/interaction.py
1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 | |
nodes(onscreen=False)
Return the current spline nodes in world or screen coordinates.
Source code in vedo/addons/interaction.py
1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 | |
off()
Disactivate/Disable the tool.
Source code in vedo/addons/interaction.py
1041 1042 1043 1044 1045 | |
on()
Activate/Enable the tool.
Source code in vedo/addons/interaction.py
1035 1036 1037 1038 1039 | |
point_color(c)
Set the color of the spline points.
Source code in vedo/addons/interaction.py
1068 1069 1070 1071 1072 | |
ps(ps)
Set the point size of the spline.
Source code in vedo/addons/interaction.py
1063 1064 1065 1066 | |
remove_node(i)
Remove specific node by its index.
Source code in vedo/addons/interaction.py
1030 1031 1032 1033 | |
render()
Render the spline.
Source code in vedo/addons/interaction.py
1052 1053 1054 1055 | |
set_nodes(pts)
Set all spline nodes from an array/list of points.
Source code in vedo/addons/interaction.py
1121 1122 1123 1124 1125 1126 1127 1128 1129 | |
spline()
Return the vedo.Line object.
Source code in vedo/addons/interaction.py
1088 1089 1090 1091 1092 1093 1094 | |
toggle()
Toggle the visibility of the tool.
Source code in vedo/addons/interaction.py
1047 1048 1049 1050 | |
ui
Flagpost
Bases: vtkFlagpoleLabel
Create a flag post style element to describe an object.
Source code in vedo/addons/ui.py
20 21 22 23 24 25 26 27 28 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 | |
base
property
writable
Return the base position of the flagpost.
top
property
writable
Return the top position of the flagpost.
color(c)
Set the color of the flagpost.
Source code in vedo/addons/ui.py
154 155 156 157 158 159 | |
off()
Hide the flagpost.
Source code in vedo/addons/ui.py
139 140 141 142 | |
on()
Show the flagpost.
Source code in vedo/addons/ui.py
134 135 136 137 | |
pos(p)
Set the position of the flagpost.
Source code in vedo/addons/ui.py
161 162 163 164 165 166 | |
text(value)
Set the text of the flagpost.
Source code in vedo/addons/ui.py
129 130 131 132 | |
toggle()
Toggle the visibility of the flagpost.
Source code in vedo/addons/ui.py
144 145 146 147 | |
use_bounds(value=True)
Set the flagpost to keep bounds into account.
Source code in vedo/addons/ui.py
149 150 151 152 | |
Icon
Bases: vtkOrientationMarkerWidget
Add an inset icon mesh into the renderer.
Source code in vedo/addons/ui.py
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 | |
LegendBox
Bases: vtkLegendBoxActor
Create a 2D legend box.
Source code in vedo/addons/ui.py
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 | |
height
property
Return the height of the legend box.
width
property
Return the width of the legend box.
font(font)
Text font face
Source code in vedo/addons/ui.py
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 | |
pos(pos)
Set the position of the legend box.
Source code in vedo/addons/ui.py
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 | |
sliders
Slider2D
Bases: SliderWidget
Add a slider which can call an external custom function.
Source code in vedo/addons/sliders.py
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 | |
Slider3D
Bases: SliderWidget
Add a 3D slider which can call an external custom function.
Source code in vedo/addons/sliders.py
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 | |
SliderWidget
Bases: vtkSliderWidget
Helper class for vtkSliderWidget
Source code in vedo/addons/sliders.py
19 20 21 22 23 24 25 26 27 28 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 | |
interactor
property
writable
Return the interactor for the slider.
range
property
writable
Return the range of the slider.
renderer
property
writable
Return the renderer for the slider.
representation
property
Return the representation of the slider.
title
property
writable
Return the title of the slider.
value
property
writable
Return the value of the slider.
add_observer(event, func, priority=1)
Add an observer to the widget.
Source code in vedo/addons/sliders.py
108 109 110 111 112 | |
is_enabled()
Check if the widget is enabled.
Source code in vedo/addons/sliders.py
104 105 106 | |
off()
Disactivate/Disable the widget
Source code in vedo/addons/sliders.py
94 95 96 97 | |
on()
Activate/Enable the widget
Source code in vedo/addons/sliders.py
89 90 91 92 | |
render()
Render the widget.
Source code in vedo/addons/sliders.py
114 115 116 117 | |
toggle()
Toggle the widget
Source code in vedo/addons/sliders.py
99 100 101 102 | |
cutters
BaseCutter
Base class for Cutter widgets.
Source code in vedo/addons/cutters.py
26 27 28 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 | |
transform
property
Get the transformation matrix.
add_observer(event, func, priority=1)
Add an observer to the widget.
Source code in vedo/addons/cutters.py
123 124 125 126 127 | |
add_to(plt)
Assign the widget to the provided Plotter instance.
Source code in vedo/addons/cutters.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
get_cut_mesh(invert=False)
Get the mesh resulting from the cut operation. Returns the original mesh and the remnant mesh.
Source code in vedo/addons/cutters.py
52 53 54 55 56 57 58 59 60 61 62 63 64 | |
invert()
Invert selection.
Source code in vedo/addons/cutters.py
66 67 68 69 70 | |
keypress_activation(value=True)
Enable or disable keypress activation of the widget.
Source code in vedo/addons/cutters.py
138 139 140 141 | |
off()
Switch the widget on or off.
Source code in vedo/addons/cutters.py
77 78 79 80 | |
on()
Switch the widget on or off.
Source code in vedo/addons/cutters.py
72 73 74 75 | |
remove_from(plt)
Remove the widget to the provided Plotter instance.
Source code in vedo/addons/cutters.py
115 116 117 118 119 120 121 | |
remove_observers(event='')
Remove all observers from the widget.
Source code in vedo/addons/cutters.py
129 130 131 132 133 134 135 136 | |
render()
Render the current state of the widget.
Source code in vedo/addons/cutters.py
143 144 145 146 147 | |
toggle()
Toggle the widget on or off.
Source code in vedo/addons/cutters.py
82 83 84 85 86 87 88 | |
BoxCutter
Bases: BaseCutter, vtkBoxWidget
Create a box widget to cut away parts of a Mesh.
Source code in vedo/addons/cutters.py
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 | |
enable_rotation(value=True)
Enable or disable rotation of the widget.
Source code in vedo/addons/cutters.py
398 399 400 401 402 | |
enable_scaling(value=True)
Enable or disable scaling of the widget.
Source code in vedo/addons/cutters.py
392 393 394 395 396 | |
enable_translation(value=True)
Enable or disable translation of the widget.
Source code in vedo/addons/cutters.py
386 387 388 389 390 | |
set_bounds(bb)
Set the bounding box as a list of 6 values.
Source code in vedo/addons/cutters.py
381 382 383 384 | |
PlaneCutter
Bases: BaseCutter, vtkPlaneWidget
Create a box widget to cut away parts of a Mesh.
Source code in vedo/addons/cutters.py
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 | |
normal
property
writable
Get the normal of the plane.
origin
property
writable
Get the origin of the plane.
enable_origin_translation(value=True)
Enable or disable rotation of the widget.
Source code in vedo/addons/cutters.py
276 277 278 279 | |
enable_rotation(value=True)
Not supported by vtkPlaneWidget — state is stored but has no effect.
Source code in vedo/addons/cutters.py
287 288 289 290 | |
enable_scaling(value=True)
Enable or disable scaling of the widget.
Source code in vedo/addons/cutters.py
281 282 283 284 285 | |
enable_translation(value=True)
Enable or disable translation of the widget.
Source code in vedo/addons/cutters.py
269 270 271 272 273 274 | |
ProgressBarWidget
Bases: Actor2D
Add a progress bar in the rendering window.
Source code in vedo/addons/cutters.py
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 | |
reset()
Reset progress bar.
Source code in vedo/addons/cutters.py
723 724 725 726 727 | |
update(fraction=None)
Update progress bar to fraction of the window width.
Source code in vedo/addons/cutters.py
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 | |
RendererFrame
Bases: Actor2D
Add a line around the renderer subwindow.
Source code in vedo/addons/cutters.py
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 | |
SphereCutter
Bases: BaseCutter, vtkSphereWidget
Create a box widget to cut away parts of a Mesh.
Source code in vedo/addons/cutters.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 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 | |
center
property
writable
Get the center of the sphere.
radius
property
writable
Get the radius of the sphere.
enable_rotation(value=True)
Not supported by vtkSphereWidget — state is stored but has no effect.
Source code in vedo/addons/cutters.py
534 535 536 537 | |
enable_scaling(value=True)
Enable or disable scaling of the widget.
Source code in vedo/addons/cutters.py
528 529 530 531 532 | |
enable_translation(value=True)
Enable or disable translation of the widget.
Source code in vedo/addons/cutters.py
522 523 524 525 526 | |
measure
DistanceTool
Bases: Group
Create a tool to measure the distance between two clicked points.
Source code in vedo/addons/measure.py
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 | |
off()
Switch tool off.
Source code in vedo/addons/measure.py
230 231 232 233 234 235 | |
on()
Switch tool on.
Source code in vedo/addons/measure.py
223 224 225 226 227 228 | |
Ruler2D
Bases: vtkAxisActor2D
Create a ruler with tick marks, labels and a title.
Source code in vedo/addons/measure.py
22 23 24 25 26 27 28 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 | |
color(c)
Assign a new color.
Source code in vedo/addons/measure.py
141 142 143 144 145 146 147 | |
off()
Switch off the ruler completely.
Source code in vedo/addons/measure.py
149 150 151 152 | |
set_points(p0, p1)
Set new values for the ruler start and end points.
Source code in vedo/addons/measure.py
154 155 156 157 158 159 | |
Ruler3D(p1, p2, units_scale=1, label='', s=None, font=None, italic=0, prefix='', units='', c=(0.2, 0.1, 0.1), alpha=1, lw=1, precision=3, label_rotation=0, axis_rotation=0, tick_angle=90)
Build a 3D ruler to indicate the distance of two points p1 and p2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
alternative fixed label to be shown |
''
|
units_scale
|
float
|
factor to scale units (e.g. μm to mm) |
1
|
s
|
float
|
size of the label |
None
|
font
|
str
|
font face. Check available fonts here. |
None
|
italic
|
float
|
italicness of the font in the range [0,1] |
0
|
units
|
str
|
string to be appended to the numeric value |
''
|
lw
|
int
|
line width in pixel units |
1
|
precision
|
int
|
nr of significant digits to be shown |
3
|
label_rotation
|
float
|
initial rotation of the label around the z-axis |
0
|
axis_rotation
|
float
|
initial rotation of the line around the main axis |
0
|
tick_angle
|
float
|
initial rotation of the line around the main axis |
90
|
Examples:

Source code in vedo/addons/measure.py
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 | |
RulerAxes(inputobj, xtitle='', ytitle='', ztitle='', xlabel='', ylabel='', zlabel='', xpadding=0.05, ypadding=0.04, zpadding=0, font='Normografo', s=None, italic=0, units='', c=(0.2, 0, 0), alpha=1, lw=1, precision=3, label_rotation=0, xaxis_rotation=0, yaxis_rotation=0, zaxis_rotation=0, xycross=True)
A 3D ruler axes to indicate the sizes of the input scene or object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xtitle
|
str
|
name of the axis or title |
''
|
xlabel
|
str
|
alternative fixed label to be shown instead of the distance |
''
|
s
|
float
|
size of the label |
None
|
font
|
str
|
font face. Check available fonts here. |
'Normografo'
|
italic
|
float
|
italicness of the font in the range [0,1] |
0
|
units
|
str
|
string to be appended to the numeric value |
''
|
lw
|
int
|
line width in pixel units |
1
|
precision
|
int
|
nr of significant digits to be shown |
3
|
label_rotation
|
float
|
initial rotation of the label around the z-axis |
0
|
[x,y,z]axis_rotation
|
(float) initial rotation of the line around the main axis in degrees |
required | |
xycross
|
bool
|
show two back crossing lines in the xy plane |
True
|
Examples:
Source code in vedo/addons/measure.py
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 | |
compute_visible_bounds(objs=None)
Calculate max objects bounds and sizes.
Source code in vedo/addons/measure.py
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 | |
