Building cylinder using isosurface
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Vittorio
am 29 Jul. 2014
Bearbeitet: Vittorio
am 29 Jul. 2014
Hello everyone,
I'm trying to create a cylindric patch using the isosurface command. Using this tutorial I created my own structure. The code is the following:
[x,y,z] = meshgrid(-1:.02:1);
blob = z <= 0 & z >= -1 & x.^2 + y.^2 <= sqrt(0.18) & x.^2 + y.^2 >= sqrt(0.15);
p = patch(isosurface(blob,0.5));
set(p, 'FaceColor', 'red', 'EdgeColor', 'none');
view(3)
camlight
alpha(0.3)
lighting gouraud
Now, I want to specify for every level of the cylinder a different radius. The values of the radii for every level are stored in a vector 1x36.
How can I modify the blob accordingly?
Thanks for any suggestions.
0 Kommentare
Akzeptierte Antwort
Matz Johansson Bergström
am 29 Jul. 2014
I would try using a function
test = @(x) abs( cos(4*x) );
[x,y,z] = meshgrid(-1:.02:1);
blob = z <= 0 & z >= -1 & x.^2 + y.^2 <= ...
sqrt(0.18*test(z)) & x.^2 + y.^2 >= ...
sqrt(0.12*test(z));
In this way you will get a wobbly thing depending on the z coordinate.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!