Tube Function

This function is the numerical analogy to the tube function in maple
ダウンロード: 158
更新 2021/9/23

ライセンスの表示

close all
[X,Y,Z] = tubeN(@(t) t/3, 30, @(t)[ t.*sin(t), t.*cos(t), 20-t],[0,20],120);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t) sin(t),20,@(t)[ t, 0*t,0*t],[0,10],40);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t)sqrt(1-t.^2),20,@(t)[sin(pi*t),t,t+1],[-1,1],50);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t)sqrt(1-t.^2),20,@(t)[sin(pi*t),cos(pi*t),t+1],[-1,1],50);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t)0.1+0*t,20,@(t)[(4 + sin(20*t)).*cos(t),(4 + sin(20*t)).*sin(t),cos(20*t)],[0,2*pi],1000);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t)0.1+0*t,20,@(t)[(2 + cos(1.5*t)).*cos(t),(2 + cos(1.5*t)).*sin(t),sin(1.5*t)],[0,4*pi],500);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t)1+0*t,20,@(t)[3.*cos(t),3.*sin(t),0*t],[0,2*pi],100);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
xfun = @(t)sign(sin(t)).*(abs(sin(t))).^0.75;
yfun = @(t)sign(cos(t)).*(abs(cos(t))).^0.75;
zfun = @(t)abs(sin(t)).^2;
[X,Y,Z] = tubeN(@(t)0.1+0*t,20,@(t)[xfun(t), yfun(t), zfun(t)],[0,2*pi],500);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud

引用

Lateef Adewale Kareem (2024). Tube Function (https://www.mathworks.com/matlabcentral/fileexchange/53907-tube-function), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2012b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersLighting, Transparency, and Shading についてさらに検索
タグ タグを追加

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
2.0.0.0

The function has been updated to now use a single 3D rotation from z dir to the direction in the path of extrusion. This eliminated the flip that occasionally occur along the path.

1.0.0.0

Just a little correction in the description