Home > arte3.2.0 > robots > equipment > tables > table_two_areas > create_table.m

create_table

PURPOSE ^

%%%%%%%%%%%%%%%%%

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

%%%%%%%%%%%%%%%%%
   LINK 0: BASE
%%%%%%%%%%%%%%%%%
add two basic shapes to this file

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %%%%%%%%%%%%%%%%%%
0002 %   LINK 0: BASE
0003 %%%%%%%%%%%%%%%%%%
0004 %add two basic shapes to this file
0005 filename='link0_test.stl'; %base
0006 cyl_radius=0.1;
0007 cyl_height = 0.05;
0008 precision = 20; % increase to obtain a more accurate drawing
0009 
0010 %create a unit height cylinder with 100 points. Radius 75
0011 [X,Y,Z] = cylinder([cyl_radius], precision);
0012 %Multiply Z by height
0013 Z=Z*cyl_height;
0014 
0015 
0016 %translation of the points
0017 X=X+0.4;
0018 Y=Y+0.2;
0019 Z=Z+0.2
0020 
0021 
0022 %Save in stl format, append to file
0023 surf2stl(filename, X, Y, Z, 'ascii', 'a+');
0024 
0025 
0026 %make a box using the cylinder function
0027 cyl_radius=0.15;
0028 cyl_height = 0.1;
0029 precision = 4; % just 4 makes a box, 3 a triangle
0030 %create the box using the cylinder function, easy
0031 [X,Y,Z] = cylinder([cyl_radius], precision);
0032 %Multiply Z by height
0033 Z=Z*cyl_height;
0034 
0035 %translation of the points
0036 X=X+1.0;
0037 Y=Y+0.2;
0038 Z=Z+0.2
0039 
0040 
0041 %Save in stl format, create new file
0042 surf2stl(filename, X, Y, Z, 'ascii', 'a+');

Generated on Fri 03-Jan-2014 12:20:01 by m2html © 2005