0001
0002
0003
0004 filename='link0.stl';
0005 cyl_radius=0.075;
0006 cyl_height = 0.290;
0007 precision = 10;
0008
0009
0010 [X,Y,Z] = cylinder([cyl_radius], precision);
0011
0012 Z=Z*cyl_height;
0013
0014
0015 surf2stl(filename, X, Y, Z, 'ascii', 'w');
0016
0017
0018 radius = linspace(0,cyl_radius,precision);
0019 theta = (pi/180)*[0:15:360];
0020 [R,T] = meshgrid(radius,theta);
0021 X = R.*cos(T);
0022 Y = R.*sin(T);
0023
0024
0025 surf2stl(filename, X, Y, 0.*X, 'ascii', 'a+');
0026
0027 surf2stl(filename, X, Y, cyl_height.*ones(size(X,1), size(X,2)), 'ascii', 'a+');
0028
0029
0030
0031
0032
0033 filename='link1.stl';
0034 cyl_radius=0.05;
0035 cyl_height = 0.150;
0036
0037
0038 [X,Y,Z] = cylinder([cyl_radius], precision);
0039
0040 Z(1,:)=Z(1,:) -cyl_height/2;
0041 Z(2,:)=Z(2,:).*(cyl_height/2);
0042
0043
0044 surf2stl(filename, X, Y, Z, 'ascii', 'w');
0045
0046
0047 radius = linspace(0,cyl_radius,precision);
0048 theta = (pi/180)*[0:15:360];
0049 [R,T] = meshgrid(radius,theta);
0050 X = R.*cos(T);
0051 Y = R.*sin(T);
0052
0053
0054 surf2stl(filename, X, Y, (-cyl_height/2).*ones(size(X,1), size(X,2)), 'ascii', 'a+');
0055
0056 surf2stl(filename, X, Y, (cyl_height/2).*ones(size(X,1), size(X,2)), 'ascii', 'a+');
0057
0058
0059
0060
0061
0062 filename='link2.stl';
0063
0064 cyl_radius=0.03;
0065 cyl_height = 0.1;
0066 [X,Y,Z] = cylinder([cyl_radius], precision);
0067
0068 Z(1,:)=Z(1,:) -cyl_height/2;
0069 Z(2,:)=Z(2,:).*(cyl_height/2);
0070
0071
0072 surf2stl(filename, X, Y, Z, 'ascii', 'w');
0073
0074 cyl_radius=0.05;
0075 cyl_height = 0.450;
0076
0077 [Z,Y,X] = cylinder([cyl_radius cyl_radius*0.8], precision);
0078
0079 X(1,:)=X(1,:) -cyl_height;
0080 X(2,:)=X(2,:).*0;
0081
0082
0083
0084
0085 surf2stl(filename, X, Y, Z, 'ascii', 'a+');
0086
0087
0088
0089
0090
0091
0092 filename='link3.stl';
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104 cyl_radius=0.04;
0105 cyl_height = 0.50;
0106
0107 [X, Y, Z] = cylinder([cyl_radius cyl_radius*0.8], precision);
0108
0109
0110 Z(2,:)=Z(2,:).*(cyl_height);
0111
0112
0113 surf2stl(filename, X, Y, Z, 'ascii', 'a+');
0114
0115
0116
0117
0118
0119 filename='link4.stl';
0120
0121 cyl_radius=0.03;
0122 cyl_height = 0.07;
0123
0124 [X, Y, Z] = cylinder([cyl_radius], precision);
0125
0126 Z(1,:)=Z(1,:) -cyl_height/2;
0127 Z(2,:)=Z(2,:).*(cyl_height/2);
0128
0129
0130 surf2stl(filename, X, Y, Z, 'ascii', 'w');
0131
0132
0133
0134
0135
0136
0137 filename='link5.stl';
0138
0139 cyl_radius=0.03;
0140 cyl_height = 0.07;
0141
0142 [X, Y, Z] = cylinder([cyl_radius], precision);
0143
0144 Z(2,:)=Z(2,:).*(cyl_height);
0145
0146
0147 surf2stl(filename, X, Y, Z, 'ascii', 'w');
0148
0149
0150
0151
0152
0153
0154 filename='link6.stl';
0155
0156 cyl_radius=0.05;
0157 cyl_height = 0.01;
0158
0159 [X, Y, Z] = cylinder([cyl_radius], precision);
0160
0161 Z(1,:)=Z(1,:) -cyl_height;
0162 Z(2,:)=Z(2,:).*0;
0163
0164 surf2stl(filename, X, Y, Z, 'ascii', 'w');
0165
0166
0167 radius = linspace(0,cyl_radius,precision);
0168 theta = (pi/180)*[0:15:360];
0169 [R,T] = meshgrid(radius,theta);
0170 X = R.*cos(T);
0171 Y = R.*sin(T);
0172
0173
0174 surf2stl(filename, X, Y, (-cyl_height).*ones(size(X,1), size(X,2)), 'ascii', 'a+');
0175
0176 surf2stl(filename, X, Y, 0.*ones(size(X,1), size(X,2)), 'ascii', 'a+');