How to create 3D volume plot of curved object with thickness
Show older comments
Hello all,
I am trying to create a volume that looks like it is part of a pipe in 3D. Currently with my limited ability, the best i can do is to draw a partial outline of the object, and iterate multiple times to create an appearance of depth. However i would like to know how can i best describe this as a proper surface.
parCircle(0,0,0,100,10,30)
function parCircle(x,y,azipos,range,drange,dazi)
degtorad = pi / 180;
lookangle = 10 * degtorad;
incl = 45 * degtorad;
theta = (2*pi-lookangle-incl):lookangle/10:(2*pi-incl);
for i = azipos-dazi:dazi/10:azipos+dazi
x_f = x + (range + drange)* cos(theta);
y_f = y + (range + drange)* sin(theta);
azipos_f = i + zeros(size(x_f));
x_n = x + (range - drange)* cos(theta);
y_n = y + (range- drange)* sin(theta);
azipos_n = i + zeros(size(x_f));
plot3(azipos_f, x_f, y_f,'b');
plot3(azipos_n, x_n, y_n,'r');
end
end
The result of this code is multiple partial circle which forms a top and bottom 'suface' not an actual volume.

Accepted Answer
More Answers (0)
Categories
Find more on Map Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!