to form a helix spiral

3 visualizaciones (últimos 30 días)
Kundan Prasad
Kundan Prasad el 13 de En. de 2022
Comentada: Voss el 13 de En. de 2022
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

Respuesta aceptada

Voss
Voss el 13 de En. de 2022
Editada: Voss el 13 de En. de 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 comentarios
Kundan Prasad
Kundan Prasad el 13 de En. de 2022
i want to maintain of gap of 0.5 within every revolution till the height of 60 how it can be done??
Voss
Voss el 13 de En. de 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])

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by