How to extrude through a mesh cylinder to create hollow hole
1 view (last 30 days)
Show older comments
Hi. I am wondering how to retrospectively create an extrusion through a cylinder which is either central or offset. Below is my code so far I need to create 5 holes around edge as shown by the hollow cylinders already created and also a hole through centre which has an internal spline. Any help would be much appreciated. Thanks in advance.
%List of Parameters
%Main Hub Parameters
%Disk_radius
R=80;
R_Vector1=[0:2:R];
R_Vector2=sort(R_Vector1,"descend");
%Case_inner_radius
R_I=20;
%case_outer_radius
R_o=25;
%spline radius
R_SO=15;
R_SI=R_SO-5;
%lower collar height
LC=45;
%Middle collar height
MC=60;
%Upper collar height
UC=80;
%Spline height
SC=15;
%Spline Parameters
No_teeth=24;
No_coords=No_teeth*6;
teeth_depth=2;
%bolt holes parameters
%radius of centre of holes
R_B=R-(R/4);
%Bolt Paramters
l_thread = 45; % Thread Length
d_thread = 6; % Thread Diameter ???
d_bolt = 11.8; % Minor Diameter
r_head = 12; % Head Radius
h_head = 6; % Head height
r_cylinder = d_bolt/2; % Cylinder Radius
%Main Wheel Hub
[x y z] = cylinder([R_I R_o R_o R_I 0 R_Vector1 R_Vector2 0 R_I R_o R_o R_I R_I],100);
z([1 2],:)=0;
z([3 4],:)=LC;
z([5:(length(R_Vector1)+5)],:)=LC;
z([(length(R_Vector1)+6):((length(R_Vector2)*2)+6)],:)=MC;
z([(length(R_Vector2)*2)+7 (length(R_Vector2)*2)+8],:)=MC;
z([(length(R_Vector2)*2)+9 (length(R_Vector2)*2)+10],:)=UC;
z([(length(R_Vector2)*2)+11],:)=MC;
mesh(x,y,z);
hold on
%Spline
[xs ys zs]=cylinder([R_SI R_SO R_SO R_SI],No_coords);
zs([1 2],:)=SC
zs([3 4],:)=MC
[xt yt zt]=cylinder([R_SI- teeth_depth], No_coords);
xs([1 4],[6:6:No_coords])=xt([1 2],[6:6:No_coords]);
xs([1 4],[5:6:No_coords])=xt([1 2],[5:6:No_coords]);
xs([1 4],[4:6:No_coords])=xt([1 2],[4:6:No_coords]);
ys([1 4],[6:6:No_coords])=yt([1 2],[6:6:No_coords]);
ys([1 4],[5:6:No_coords])=yt([1 2],[5:6:No_coords]);
ys([1 4],[4:6:No_coords])=yt([1 2],[4:6:No_coords]);
mesh(xs,ys,zs)
%bolt holes
%bolt hole 0
xh0=0;
yh0=R_B;
[xh,yh,zh]=cylinder([6 7 7 6],100);
zh([1 2],:)=LC;
zh([3 4],:)=MC;
xh=xh+xh0;
yh=yh+yh0;
mesh(xh,yh,zh);
%bolt hole 1
xh10=cos(pi/10)*R_B;
yh10=sin(pi/10)*R_B;
[xh1,yh1,zh1]=cylinder([6 7 7 6],100);
zh1([1 2],:)=LC;
zh1([3 4],:)=MC;
xh1=xh1+xh10;
yh1=yh1+yh10;
mesh(xh1,yh1,zh1);
%bolt hole 2
xh20=sin(pi/5)*R_B;
yh20=-cos(pi/5)*R_B;
[xh2,yh2,zh2]=cylinder([6 7 7 6],100);
zh2([1 2],:)=LC;
zh2([3 4],:)=MC;
xh2=xh2+xh20;
yh2=yh2+yh20;
mesh(xh2,yh2,zh2)
%bolt hole 3
xh30=-sin(pi/5)*R_B;
yh30=-cos(pi/5)*R_B;
[xh3,yh3,zh3]=cylinder([6 7 7 6],100);
zh3([1 2],:)=LC;
zh3([3 4],:)=MC;
xh3=xh3+xh30;
yh3=yh3+yh30;
mesh(xh3,yh3,zh3)
%bolt hole 4
xh40=-cos(pi/10)*R_B;
yh40=sin(pi/10)*R_B;
[xh4,yh4,zh4]=cylinder([6 7 7 6],100);
zh4([1 2],:)=LC;
zh4([3 4],:)=MC;
xh4=xh4+xh40;
yh4=yh4+yh40;
mesh(xh4,yh4,zh4);

0 Comments
Answers (0)
See Also
Categories
Find more on Splines 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!