Hi,
Kindly add below code snippet to generate the contour of the honeycomb structure and plot it on top of the original honeycomb plot :
%% Generate Contour
contour_x = [];
contour_y = [];
connectivity = [];
for cont1 = 1:size(znodes, 1)
contour_x = [contour_x; znodes(cont1, [2, 4, 6, 8])];
contour_y = [contour_y; znodes(cont1, [3, 5, 7, 9])];
connectivity = [connectivity; [cont1, cont1, cont1, cont1]];
end
%% Plotting
figure
hold on
% Plot original honeycomb structure
for cont1 = 1:size(elems, 1)
plot(nodes(elems(cont1, 2:3), 2), nodes(elems(cont1, 2:3), 3), 'k:')
end
% Plot contour
for cont1 = 1:size(contour_x, 1)
plot(contour_x(cont1, :), contour_y(cont1, :), 'r-')
end
The above mentioned code snippet generates a contour plot by extracting the x and y coordinates from the 'znodes' matrix, which represents modified nodes of a honeycomb structure. The extracted coordinates are stored in 'contour_x' and 'contour_y' matrices, respectively.Then, the code plots the original honeycomb structure as a black dotted line by iterating over the 'elems' matrix. Finally, the code plots the contour by iterating over the ‘contour_x’ matrix. The x and y coordinates of the contour points are extracted and plotted as a red solid line.
The output of the above code snippet is attached below for your reference.
Hope this helps.
Thankyou