to form a helix spiral

3 次查看(过去 30 天)
Kundan Prasad
Kundan Prasad 2022-1-13
评论: Voss 2022-1-13
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

采纳的回答

Voss
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 个评论
Kundan Prasad
Kundan Prasad 2022-1-13
i want to maintain of gap of 0.5 within every revolution till the height of 60 how it can be done??
Voss
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 CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by