不幸的是,我對此沒有足夠的瞭解,無法對此有任何想法。但是,如果您之前沒有看到過,我想提一下以下內容。已經有discussions on tetramesh before。一個快速的解決辦法是寫了由martin_helm
:
function tetramesh(T, X, C)
if nargin < 3
C = mod((1:size(T, 1))'-1, size(colormap(), 1) + 1);
endif
triang = [T(:, 1) T(:, 2) T(:, 3); ...
T(:, 2) T(:, 3) T(:, 4); ...
T(:, 3) T(:, 4) T(:, 1); ...
T(:, 4) T(:, 1) T(:, 2)];
patch("Faces", triang, "Vertices", X, "FaceVertexCData", [C; C; C; C])
endfunction
隨着一些用法示例:
backend("fltk") % backend("gnuplot") could also be used
d = [-1 1];
[x,y,z] = meshgrid(d,d,d);
x = [x(:);0];
y = [y(:);0];
z = [z(:);0];
tetra = delaunay3(x,y,z);
X = [x(:) y(:) z(:)];
tetramesh(tetra, X)
view(30,30)