Visualize 3D domain

6 ビュー (過去 30 日間)
Thales
Thales 2020 年 4 月 8 日
There are a bunch of options to visualize Volumetric (4D) data, as in here.
What I am interested, however, is to visualize the 3D domain.
Now, the code itself is not the actual implementation, but it makes easier to explain. Say I want to visualize a 3D domain (like a 3D mesh) in polar coordinates.
The 3 spatial coordinates are , and the z coordinate changes as a function of the other variables, ie, .
clc; clear; close all force;
r = 1:0.2:2; % r coordinate discretization, from ri=1 to ro=2
theta = 0:pi/32:pi/4; % theta coordinate discretization, from theta_i = 0 to theta_o = pi/4
z = 0:0.2:1; % z coordinate discretization, from 0 to z_max, z_max = z(r,theta)
[R,Theta,Z] = ndgrid(r,theta,z);
figure; hold on;
for n=1:size(Z,3)
z_max = 1+Theta(:,:,1)/theta(end);
Z(:,:,n) = z(n)*z_max;
mesh(R(:,:,n),Theta(:,:,n),Z(:,:,n),'FaceAlpha',0.5,'edgecolor',[0.5 0.5 0.5])
end
xlabel('r')
ylabel('\theta')
zlabel('z')
view(3)
Now, the code above produces the following figure:
This is almost what I want, but not exactly what I want. It sure helps to visualize the 3D domain, but I would like to also add the edge lines in the z direction, to create 3D cube-like shapes
Each vertex of the above grids is a vertex for a cube. Maybe a for loop could help to create this 3D mesh domain, but I don't know how.
Notice this is not the function itself I want to plot. Say, I have a dependent variable , so I could use the methods described in volume visualizations to visualize 4D data. What I want to plot is the 3D mesh that are the spatial variables and the domain of ϕ.
Is the multifaceted patch a solution to the problem or is there a better solution to it?

回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by