2
votes

I want to create and display a 3D shell in matlab, (for example a barrel with 100 elements) and I have a thickness vector(100*1) that contains the thicknesses of 100 shell elements. So I have an array that contains coordinates of shell nodes and elements and a vector that contains the thickness of shell elements.

Now how can I display this 3D shell that each element , depend on value of its thickness was different in colour (gray)?

Or how can I joint coordinates array and thickness vector or map the thickness vector on the shape of 3D shell and display a gray 3D shell?

EDIT: This question is about topology optimization. In final I must be have a figure like in attachment.

I have a vector with size 100*1 for example [1 0 0 1 0 ...]. The name of this vector is thickness vector. ‘1’ means solid and ‘0’ means void in thickness vector.

And I have an array (XYZ) for ploting 3D shell shape. I meshed this 3D shell to 100 rectangle elements. So corresponding each element in 3D shell I have one number (0 or 1) in thickness vector.

Now how can I display thickness of each element on output 3D shell plot with colour (e.g in final plot we can see each element that is solid be black and each element that is void be white). Or how can I link or map thickness vector on the shell plot?

Link to the picture: http://s9.picofile.com/file/8310446684/Capture.JPG

1
Can you be more specific about what you're trying to do (e.g. including pictures), and also include any code that you've written so others can reproduce it?verbatross

1 Answers

1
votes

First, you can convert yout thickness vector thickness_V into a 10*10 matrix.

thickness_M = [];
for i = 1:10
    thickness_M = [thickness_M thickness_V(1+10*(i-1):10+10*(i-1))];
end

Then you can use surf combined with the option colormap gray, since you only have two possible values, the gray shades will only be white, or black.

Here is an example I just did:

[X,Y] = meshgrid(1:10);
Z = -(X-5).^2 - (Y-5).^2;
thickness_M = eye(10,10);
s = surf(X, Y, Z, -thickness_M);
colormap gray;

enter image description here