to form a helix spiral
3 次查看(过去 30 天)
显示 更早的评论
Dear all
I am unable to for a helix spiral using attached code.
First i want to mirror the generated curve in opposite direction and then i want a helix spiral to be formed with certain height and with certain gap. The gap can be taken as 0.5 and height as 60 mm.
The code is attached below.
Thank you
clc
R=30; %% radius of curvature
W=0.0125; %% width of grating
r=10; %% radius of workpiece
th_1=(asin(W/R)); %% angle at which blazed grating existd
th_2=2*(asin(r/R)); %% angle at which primary profile exists
n=round(degr_2/degr); %% number of grating
for i=1:n
th (i)= (((i*th_1)-((th_2)/2)));
x(i)= -(R*cos(th (i)));
z(i)= (R*sin(th (i)));
end
X1=x;
Z1=z;
figure (1)
plot(X1,Z1); hold on
0 个评论
采纳的回答
Voss
2022-1-13
编辑:Voss
2022-1-13
clc
R=30; %% radius of curvature
W=0.0125; %% width of grating
r=10; %% radius of workpiece
th_1=(asin(W/R)); %% angle at which blazed grating existd
th_2=2*(asin(r/R)); %% angle at which primary profile exists
% n=round(degr_2/degr); %% number of grating
n = 1e5;
for i=1:n
th (i)= (((i*th_1)-((th_2)/2)));
x(i)= -(R*cos(th (i)));
z(i)= (R*sin(th (i)));
end
X1=x;
Z1=z;
Y1=th;
figure (1)
% plot(X1,Z1); hold on
plot3(X1,Y1,Z1);
xlabel('x');
ylabel('th');
zlabel('z');
view([30 60])
2 个评论
Voss
2022-1-13
clc
R=30; %% radius of curvature
W=0.0125; %% width of grating
r=10; %% radius of workpiece
th_1=(asin(W/R)); %% angle at which blazed grating existd
th_2=2*(asin(r/R)); %% angle at which primary profile exists
% n=round(degr_2/degr); %% number of grating
n = (2*pi/th_1)*120;
for i=1:n
th(i) = i*th_1 - th_2/2;
x(i)= -R*cos(th(i));
z(i)= R*sin(th(i));
end
X1=x;
Z1=z;
Y1=th./(240*pi-th_2/2)*60;
figure (1)
% plot(X1,Z1); hold on
plot3(X1,Y1,Z1);
xlabel('x');
ylabel('th');
zlabel('z');
view([30 60])
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!