3D PRINTERING: MAKING A thing WITH OPENSCAD


This week, we’re starting off with OpenSCAD, a 3D modelling program that’s a lot more like programming than drawing. A great deal of beneficial 3D printable objects – including the parts for a great deal of RepRaps – are created in OpenSCAD, so ideally by the end of this you’ll be able to style your own parts.

This isn’t indicated to be a total tutorial for OpenSCAD; I’m just demoing SCAD sufficient to develop a basic part. next week I’ll a lot of likely be creating a part with AutoCAD, however if you have an concept of what software application tools I must utilize as a tutorial to make a part, leave a note in the comments. inspect out the 3D Printering guide to making a part with OpenSCAD below.

First, some basics
The fundamental concept behind OpenSCAD is constructive solid geometry this is a modeling method that utilizes fundamental primitives such as a sphere, cube, or cylinder together with fundamental boolean operations to produce an object. utilizing words to explain this method is just terrible, so here’s a very, extremely short example. To the ideal is a photo of two objects produced in OpenSCAD, a cube as well as a cylinder below is the code, which you must be able to comply with easily:

innan

1
2
3
4
5
6
7
module example() {
     sphere(10);
     translate([15,15,-10]){
          cylinder(h=20, r=5);
}
}
exempel();

Brain dead simple, right? We’re just producing a ball with a radius of 10 as well as a cylinder with a radius of 5 as well as a height of 20. We’re equating the cylinder in area by 15 units in the x as well as y axes, as well as down 10 units in the z axis. Here’s where constructive solid geometry comes in. We can integrate those two 3D primitives by utilizing the union() command like so:

1
2
3
4
5
6
union(){
   sphere(10);
   translate([0,0,-10]){
      cylinder(h=20, r=5);
}
}

In OpenSCAD, the union command is implicit. a lot of of the time, you don’t requirement it, except in situations where you’re integrating other boolean operations. There are two a lot more boolean operations we can utilize – difference, or just subtracting one item from another, as well as intersection. right here is the difference command:

1
2
3
4
5
6
skillnad(){
   sphere(10);
   translate([0,0,-10]){
      cylinder(h=20, r=5);
}
}

And the intersection command:

1
2
3
4
5
6
genomskärning(){
   sphere(10);
   translate([0,0,-10]){
      cylinder(h=20, r=5);
}
}

That’s constructive solid geometry. With these boolean operations, you can make just about anything. I mean it’s time to demonstrate that, huh?

Vår grej
considering that I’m going to be doing a number of tutorials of exactly how to develop a ‘thing’, it makes sense to have one basic ‘thing’ to make with these tutorials. selecting an item to copy was suddenly hard, however after pulling out a few books on engineering drawing as well as drafting, I settled on the above ‘thing’, from engineering drawing (French, 1929). If you’re wondering why I selected something so strange out of a book so old, just remember: the people who created the Apollo spacecraft discovered drafting as well as drawing with this book. Also, this is my column, so offer with it. By integrating a few cylinders as well as cubes it’s relatively simple to produce a extremely fundamental shape of what will ended up being our completed part. The preliminary code is below, together with a render:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module thing()
{
skillnad(){
        cylinder(h=7, r=19);
        cylinder(h=7, r=8);
}

     translate([-23,10,0]){
        cube([46, 10, 7]);
}

     translate([-10,-26,0]){
        cube([20, 16, 7]);
}

     translate([-10,-26,7]){
        cube([20,4,7]);
}
}
sak();

Again, this is just the beginning of our part. we’re only utilizing cubes as well as cylinders here. If you’re wondering why the dimensions we’re utilizing are so odd, it’s since the original part (published in my fourth edition copy of Engineering Drawing in 1929, however it might be from the very first edition published in 1911) was created in eighths of an inch. I’m just composing my OpenSCAD so one system is equal to one eighth of an inch. When we print this out, we can repair any type of size problems just by multiplying. To surface up the primary body of our part, we requirement to add a few cylinders on the flange. One thing that’s truly awesome about OpenSCAD is the capability to produce little parts as well as later integrate them with the union command. Here’s a collection of cylinders for our flange:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module flange() {
     rotate([270,0,180]){
          translate([-10,6,-4]){
skillnad(){
union(){
                   cube([20,12,4]);
                   translate([10,0,0]){
                      cylinder(h=4, r=10);
}
}
                 translate ([10,0,0]) {
cylinder (H = 4, R = 3,5);
rotera ([0,0,90]) {
cylinder (H = 3, R = 7);
}
}
}
}
}
}

Eftersom OPENSCAD är generellt bara kod, kan vi bara ringa den här modulen på det lämpliga området i koden. Du kan se detta i den färdiga koden några rullar ner. Perfekt nu Vår del visas så här: Nu är det enda som delegerat till att lägga till den här saken 3/8 “platsen på den primära kroppen, liksom några filéer. Jag lämnar filéerna som en övning till läsaren, men här är koden såväl som ett foto för den resulterande delen:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Modul sak ()
{
skillnad(){
cylinder (H = 7, R = 19);
cylinder (H = 7, R = 8);
rotera ([0,0,225]) {
Översätt ([0,1,5,0]) {
kub ([20,3,7]);
}
}
}
Översätt ([- 23,10,0]) {
kub ([46, 10, 7]);
}
Översätt ([- 10, -26,0]) {
kub ([20, 10, 7]);
}
Översätt ([0, -26,24]) {
fläns();
}
}

modulfläns () {
rotera ([270,0,180]) {
Översätt ([- 10,6, -4]) {
skillnad(){
union(){
kub ([20,12,4]);
Översätt ([10,0,0]) {
cylinder (H = 4, R = 10);
}
}
Översätt ([10,0,0]) {
cylinder (H = 4, R = 3,5);
rotera ([0,0,90]) {
cylinder (H = 3, R = 7);
}
}
}
}
}
}

sak();

Så där går du. En sak, producerad med OpenScad. Är det den slutgiltiga guiden för att skapa saker med OpenScad? Nej, men det är mycket mer än tillräckligt för att få fötterna våta. Det är tillräckligt så att du kan skriva egna delar såväl som skicka dem till en 3D-skrivare. Nästa vecka gör jag exakt samma del i AutoCAD, som måste jämföra med andra CAD-paket. Om du har någon typ av önskan att se den här delen med ett mer 3D-stilpaket, lämna en anteckning i kommentarerna.

Leave a Reply

Your email address will not be published. Required fields are marked *