Dear Matlab community,
I would like to generate a 3D graph of a vibrational mode shape using 2D data of a solid of revolution (the cross-section of which lies in the r-z plane of a cylindrical coordinate system), by revolving the 2D data around the z-axis in the circumferential direction θ by 2π radians. I have a point cloud of data points of the meshed geometry where each corresponds to a node in a finite element model. From that model I also have the the three displacement components at each node, u (in radial direction r), v (in circumferential direction θ) and w(in axial direction z).
The undeformed geometry can be seen in the following graph (which is a simplification of the actual geometry I am solving for, but essentially includes similar geometric features, but us not as symmetric)
The red dots correspond to the nodes in the finite element model and the blue line corresponds to the extreme edge(s).
The displaced geometry (,,) of a mode at the plane where θ=0 looks as follows (after scaling it):
where the cyan line shows the edges of the undeformed geoemetry. I neglected the circumferential displacement here but it needs to be included in the 3D figure.
The displacements vary sinusoidally around the circumference, which needs to be included in the final 3D plot as:
Ideally, I would like to plot the 3D mode shape as shown in the figure below. It is taken directly from a finite element software, but I can't use it, since I apply further processing outside the software. But after finishing my calculations, I again end up with 3 displacement components at the same nodes and could plot the new ones. The colourmap c represents the magnitude of the overall displacement at each point as .
In the appendix I provide the data of the wheel in the data.mat file. The file is required to run the code below. It includes the nodal coordinates r and z of the above-shown undeformed 2D geometry and the three displacement components for the single mode. It would be sufficient to revolve the outer edges (blue lines in the first/second figure), instead of revolving all points. A good starting point is probably to try and plot the undeformed shape first, before going any further. Afterwards, the displacements could be added to each point and maybe it is possible to add a colourmap. I add a small piece of code below, which only includes my start. I have, however, already had problems coming up with something to plot the undeformed geoemtry, other than creating a 3D point cloud. I am very sorry, I can't provide you more. I'm not very experienced in plotting something in 3D in MATLAB and I am not sure how to tackle this problem, to be honest.
I am really hoping anyone could provide me some adivce on how to plot a 3D shape from the 2D data, as shown above. I am grateful for anything, I hope my description makes sense. This is the first time I am using the forum, I hope I was precise enough for you, to understand my problem. If not, please don't hesitate to tell me and I will do my best providing all neccesary information. Thank you very much in advance.
N = 30;
theta = 0:pi/N:2*pi;
n = 2;
c = sqrt(u.^2+v.^2+w.^2);
u = u./max(abs([u', v', w']));
v = v./max(abs([u', v', w']));
w = w./max(abs([u', v', w']));
rEdg = r(pEdge);
zEdg = z(pEdge);
uEdg = u(pEdge);
vEdg = v(pEdge);
wEdg = w(pEdge);
scale = 0.1
R0 = r.*ones(1,length(theta));
Z0 = z.*ones(1,length(theta));
Th0 = theta.*ones(length(R0),1);
[X0,Y0,Z0] = pol2cart(Th0,R0,Z0);
R = rEdg+uEdg*scale.*ones(1,length(theta)).*cos(n*theta);
Z = zEdg+wEdg*scale.*ones(1,length(theta)).*cos(n*theta);
Th = theta+vEdg*scale.*sin(n*theta);
[X,Y,Z] = pol2cart(Th,R,Z);
for ith = 1:length(theta)
u_theta = u*scale.*cos(n*theta(ith));
v_theta = v*scale.*sin(n*theta(ith));
w_theta = w*scale.*cos(n*theta(ith));
for i = 1:size(Connect,1)
Conn = (Connect(i,:));
re = r(Conn)+u_theta(Conn);
ze = z(Conn)+w_theta(Conn);
the = theta(ith)+v_theta(Conn);
[Xe,Ye,Ze] = pol2cart(the,re,ze);
patch(Xe,Ze,Ye,[0.5 0.5 0.5])
axis([-0.6 0.6 -0.1 0.1 -0.6 0.6])