Файл: Отчет по лабораторным работам Дисциплина Автоматизированное управление систем.docx
Добавлен: 10.01.2024
Просмотров: 127
Скачиваний: 1
ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.
Министерство науки и высшего образованияФедеральное государственное бюджетное образовательное учреждение высшего образования«Уфимский государственный авиационный технический университет» Кафедра АСУОтчет по лабораторным работам Дисциплина: «Автоматизированное управление систем»Выполнил: ст. гр. ПИ-325БзуКанбеков В.В.Проверил: Доцент каф. АСУУчитель: Е. А. ДроньУфа – 2022Лабораторная работа №13D моделирование в OpenSCADЗадача: научиться пользоваться ПО OpenSCAD и смоделировать ряд моделей.Ход работы:Сначала скачаем ПО с официального сайта и установим его.Начнем выполнять по заданиям.Задание 1:$fn = 72 * 1; width = 25; thickness = 3; holedia = width - thickness; difference(){cube(size = width, center=true); cube(size = width - thickness, center = true); cylinder(r = holedia / 2, h = width + 2, center = true); rotate([90, 0, 0]) cylinder(r = holedia / 2, h = width + 2, center = true); rotate([0, 90, 0]) cylinder(r = holedia / 2, h = width + 2, center = true); }sphere(r = width / 2, center = true); translate([0,0,-15])cylinder(r1=4, r2=1, h=20, center=true, $fn=50); translate([0,0,-25])cylinder(3,10,10);Рисунок 1- куб в цилиндреЗадание__2'>Задание 2:union() {// headtranslate([0, 0, 120])difference() {union() {// teardrop shapesphere(r = 20);translate([0, 0, 20 * sin(30)])cylinder(h = 30, r1 = 20 * cos(30), r2 = 0);// dolloptranslate([0, 0, 30 + 20 * sin(30)])sphere(r = 6);}//cut out slotrotate([45, 0, 0])translate([-20, 0, 0])cube([40, 5, 40]);}// neckcylinder(h = 120, r1 = 18, r2 = 12);// basecylinder(h = 20, r1 = 35, r2 = 25);// collartranslate([0, 0, 90])intersection() {cylinder(h = 20, r1 = 20, r2 = 0);translate([0, 0, 7])mirror([0, 0, 1])cylinder(h = 20, r1 = 20, r2 = 0);}} Рисунок 2- шахматный «Слон»Задание__4_(Hull)'>Задание 3 (intersection)cube_size=60;module saizi(){intersection(){cube(cube_size,center=true);sphere(cube_size/1.3,center=true);}}font="Wingdings";letter_size=40;letter_height=5;o=cube_size/2-letter_height/2;module letter(l){linear_extrude(height=letter_height){text(l,size=letter_size,font=font,halign="center",valign="center",$fn=16);}}difference(){saizi();translate([0,0,o])letter(font=("1"),"1");translate([0,0,-o-letter_height])letter(font=("1"),"2");translate([0,-o,0])rotate([90,0,0])letter(font=("1"),"3"); translate([o,0,0])rotate([90,0,90])letter(font=("1"),"4");translate([0,o,0])rotate([90,0,180])letter(font=("1"),"5");
translate([-o,0,0])rotate([90,0,-90])letter(font=("1"),"6");} Рисунок 3- Игравые костиЗадание__7'>Задание 4 (Hull)difference () { n = 500;h = 1;step = 360/n;points = [ for (t=[0:step:359.999]) [16*pow(sin(t),3), 13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t)]];linear_extrude(height=h)polygon(points);text1="УГАТУ";font1="Arial:style=Bold Italic";translate ([-10,-2,0])rotate ([0,0,0])linear_extrude (height=5){text(text1,font=font1,size=5);}}Рисунок 4- Сердце «УГАТУ»Задание__9'>Задание 5$fn=150;difference(){cube([40,40,5]);for(x=[7,20,33],y=[10,30])translate([x,y,5]) sphere(5);}Рисунок 5- Доска с цилиндрамиЗадание 6 (Создать любую кружку)scale([2,2,2]){union(){difference(){cylinder(h=20, r1=6, r2=11);translate([0,0,2]) cylinder(h=20, r1=5, r2=10);}difference(){ rotate([90,90,0]){difference(){translate([-14,12,-2.5]) cylinder(r=6, h=5);translate([-14,11,0]) sphere(5);}}translate([0,0,2]) cylinder(h=20, ri=5, r2=10);}}}Рисунок 6- КружкаЗадание 7 (Hull + intersection)$fn=150;//Головаunion(){difference(){cylinder(r=20, h=2);translate([0,-20,1]) cube([40,40,4], center=true);translate([9,9,-1]) cylinder(r=2,h=4);translate([-9,9,-1]) cylinder(r=2,h=4);}}hull(){translate([-13,23,-1]) cylinder(r=0.5,h=4);translate([-10,17,-1]) cylinder(r=0.8,h=4);}hull(){translate([13,23,-1]) cylinder(r=0.5,h=4);translate([10,17,-1]) cylinder(r=0.8,h=4);}//Туловищеhull(){translate([0,-13,0]) cube([40,20,2], center=true);hull(){translate([-17,-40,0]) cylinder(r=3,h=2);translate([17,-40,0]) cylinder(r=3,h=2);}}//Рукиhull(){translate([27,-10,0]) cylinder(r=4,h=2);translate([27,-30,0]) cylinder(r=4,h=2);}hull(){translate([-27,-10,0]) cylinder(r=4,h=2);translate([-27,-30,0]) cylinder(r=4,h=2);}//Ногиhull(){translate([10,-10,0]) cylinder(r=4,h=2);translate([10,-55,0]) cylinder(r=4,h=2);}hull(){translate([-10,-10,0]) cylinder(r=4,h=2);translate([-10,-55,0]) cylinder(r=4,h=2);}Рисунок 7- АндроидЗадание 8 (rotate extrude)$fn=40;difference(){cylinder(r1=15,r2=20,h=50);rotate_extrude(convexity=50){translate([17,15])circle(12);
}rotate_extrude(convexity=50){translate([19,38])circle(8);}translate([0,0,39]) cylinder(r1=10,r2=20,h=30);}Рисунок 8- Фигура Задание 9 (цикл)$fn=40;cube([50,50,5]);for (x=[5,15,25,35,45], y = [5,15,25,35,45]) translate([x, y, 0]) cylinder(r=2,h=10);for (x=[10,20,30,40], y = [10,20,30,40]) translate([x, y, 0]) cylinder(r=2,h=10);Рисунок 9- Доска с циклом из цилиндровЗадание 10Render_Quality = 24; //[24:Draft,60:production]scale_factor = 1;//[.5,1,1.5,2,2.5,3]text_height=7; // [6:15]text_font = "write/orbitron.dxf";//[write/Letters.dxf,write/orbitron.dxf,write/knewave.dxf,write.braille.dxf,write/Blackrose.dxf]text1 = "Do you wanna";text2 = "build a snowman?";text_shift = 0; // [-10:10]snowman ();emboss_depth = 3*1;$fn=Render_Quality;module snowman(){scale([scale_factor,scale_factor,scale_factor]){scale([2,2,2]){ translate([0,0,35])sphere(5); translate([0,0,24])sphere(7); translate([0,0,10])sphere(10); writesphere(text1,[0,0,0],radius=10,height=17,t=3,up=text_shift+1.2*text_height/2,h=text_height,font=text_font); writesphere(text2,[0,0,0],radius=10,height=17,down=0-text_shift+1.2*text_height/2,t=3,h=text_height,font=text_font); rotate([-90,0,0]) translate([0,-35,-7])cylinder(h=3,r1=0,r2=1); translate([0,0,39])cylinder(.5,6,6); translate([0,0,39.5])cylinder(h=3,r=4.5); translate([-2,-4.2,36])cube(1,center=true); translate([2,-4.2,36])cube(1,center=true); translate([-3,-3.6,33.5])cube(.7,center=true); translate([-2,-4,33])cube(.7,center=true); translate([-1,-4.3,32.7])cube(.7,center=true); translate([0,-4.45,32.5])cube(.7,center=true); translate([1,-4.3,32.7])cube(.7,center=true); translate([2,-4,33])cube(.7,center=true); translate([3,-3.6,33.5])cube(.7,center=true); translate([0,-5.2,28])sphere(1.3); translate([0,-6.5,25.5])sphere(1.3); translate([0,-6.3,22.5])sphere(1.3); translate([-10,0,28]) rotate([0,-45,0])cylinder(h=10,r=.7,center=true); translate([10,0,28]) rotate([0,45,0])cylinder(h=10,r=.7,center=true);}}Рисунок 10- СнеговикВывод: С помощью таких инструментов как OpenSCAD можно делать несложные модели, что является средством производства.
translate([-o,0,0])rotate([90,0,-90])letter(font=("1"),"6");} Рисунок 3- Игравые костиЗадание__7'>Задание 4 (Hull)difference () { n = 500;h = 1;step = 360/n;points = [ for (t=[0:step:359.999]) [16*pow(sin(t),3), 13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t)]];linear_extrude(height=h)polygon(points);text1="УГАТУ";font1="Arial:style=Bold Italic";translate ([-10,-2,0])rotate ([0,0,0])linear_extrude (height=5){text(text1,font=font1,size=5);}}Рисунок 4- Сердце «УГАТУ»Задание__9'>Задание 5$fn=150;difference(){cube([40,40,5]);for(x=[7,20,33],y=[10,30])translate([x,y,5]) sphere(5);}Рисунок 5- Доска с цилиндрамиЗадание 6 (Создать любую кружку)scale([2,2,2]){union(){difference(){cylinder(h=20, r1=6, r2=11);translate([0,0,2]) cylinder(h=20, r1=5, r2=10);}difference(){ rotate([90,90,0]){difference(){translate([-14,12,-2.5]) cylinder(r=6, h=5);translate([-14,11,0]) sphere(5);}}translate([0,0,2]) cylinder(h=20, ri=5, r2=10);}}}Рисунок 6- КружкаЗадание 7 (Hull + intersection)$fn=150;//Головаunion(){difference(){cylinder(r=20, h=2);translate([0,-20,1]) cube([40,40,4], center=true);translate([9,9,-1]) cylinder(r=2,h=4);translate([-9,9,-1]) cylinder(r=2,h=4);}}hull(){translate([-13,23,-1]) cylinder(r=0.5,h=4);translate([-10,17,-1]) cylinder(r=0.8,h=4);}hull(){translate([13,23,-1]) cylinder(r=0.5,h=4);translate([10,17,-1]) cylinder(r=0.8,h=4);}//Туловищеhull(){translate([0,-13,0]) cube([40,20,2], center=true);hull(){translate([-17,-40,0]) cylinder(r=3,h=2);translate([17,-40,0]) cylinder(r=3,h=2);}}//Рукиhull(){translate([27,-10,0]) cylinder(r=4,h=2);translate([27,-30,0]) cylinder(r=4,h=2);}hull(){translate([-27,-10,0]) cylinder(r=4,h=2);translate([-27,-30,0]) cylinder(r=4,h=2);}//Ногиhull(){translate([10,-10,0]) cylinder(r=4,h=2);translate([10,-55,0]) cylinder(r=4,h=2);}hull(){translate([-10,-10,0]) cylinder(r=4,h=2);translate([-10,-55,0]) cylinder(r=4,h=2);}Рисунок 7- АндроидЗадание 8 (rotate extrude)$fn=40;difference(){cylinder(r1=15,r2=20,h=50);rotate_extrude(convexity=50){translate([17,15])circle(12);
}rotate_extrude(convexity=50){translate([19,38])circle(8);}translate([0,0,39]) cylinder(r1=10,r2=20,h=30);}Рисунок 8- Фигура Задание 9 (цикл)$fn=40;cube([50,50,5]);for (x=[5,15,25,35,45], y = [5,15,25,35,45]) translate([x, y, 0]) cylinder(r=2,h=10);for (x=[10,20,30,40], y = [10,20,30,40]) translate([x, y, 0]) cylinder(r=2,h=10);Рисунок 9- Доска с циклом из цилиндровЗадание 10Render_Quality = 24; //[24:Draft,60:production]scale_factor = 1;//[.5,1,1.5,2,2.5,3]text_height=7; // [6:15]text_font = "write/orbitron.dxf";//[write/Letters.dxf,write/orbitron.dxf,write/knewave.dxf,write.braille.dxf,write/Blackrose.dxf]text1 = "Do you wanna";text2 = "build a snowman?";text_shift = 0; // [-10:10]snowman ();emboss_depth = 3*1;$fn=Render_Quality;module snowman(){scale([scale_factor,scale_factor,scale_factor]){scale([2,2,2]){ translate([0,0,35])sphere(5); translate([0,0,24])sphere(7); translate([0,0,10])sphere(10); writesphere(text1,[0,0,0],radius=10,height=17,t=3,up=text_shift+1.2*text_height/2,h=text_height,font=text_font); writesphere(text2,[0,0,0],radius=10,height=17,down=0-text_shift+1.2*text_height/2,t=3,h=text_height,font=text_font); rotate([-90,0,0]) translate([0,-35,-7])cylinder(h=3,r1=0,r2=1); translate([0,0,39])cylinder(.5,6,6); translate([0,0,39.5])cylinder(h=3,r=4.5); translate([-2,-4.2,36])cube(1,center=true); translate([2,-4.2,36])cube(1,center=true); translate([-3,-3.6,33.5])cube(.7,center=true); translate([-2,-4,33])cube(.7,center=true); translate([-1,-4.3,32.7])cube(.7,center=true); translate([0,-4.45,32.5])cube(.7,center=true); translate([1,-4.3,32.7])cube(.7,center=true); translate([2,-4,33])cube(.7,center=true); translate([3,-3.6,33.5])cube(.7,center=true); translate([0,-5.2,28])sphere(1.3); translate([0,-6.5,25.5])sphere(1.3); translate([0,-6.3,22.5])sphere(1.3); translate([-10,0,28]) rotate([0,-45,0])cylinder(h=10,r=.7,center=true); translate([10,0,28]) rotate([0,45,0])cylinder(h=10,r=.7,center=true);}}Рисунок 10- СнеговикВывод: С помощью таких инструментов как OpenSCAD можно делать несложные модели, что является средством производства.