to form a helix spiral
3 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Voss
on 13 Jan 2022
Edited: Voss
on 13 Jan 2022
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 Comments
Voss
on 13 Jan 2022
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])
More Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing 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!