to form a helix spiral

3 visualizzazioni (ultimi 30 giorni)
Kundan Prasad
Kundan Prasad il 13 Gen 2022
Commentato: Voss il 13 Gen 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

Risposta accettata

Voss
Voss il 13 Gen 2022
Modificato: Voss il 13 Gen 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 Commenti
Kundan Prasad
Kundan Prasad il 13 Gen 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 il 13 Gen 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])

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Graphics Object Programming in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by