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:

до

1.
2.
3.
4.
5.
6.
7.
module example() {
     sphere(10);
     translate([15,15,-10]){
          cylinder(h=20, r=5);
}
}
пример();

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.
разница(){
   sphere(10);
   translate([0,0,-10]){
      cylinder(h=20, r=5);
}
}

And the intersection command:

1.
2.
3.
4.
5.
6.
intersection(){
   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?

Наша вещь
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()
{
разница(){
        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]);
}
}
предмет();

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]){
разница(){
                 union(){
                   cube([20,12,4]);
                   translate([10,0,0]){
                      cylinder(h=4, r=10);
}
}
                 translatе ([10,0,0]) {
цилиндр (H = 4, R = 3,5);
вращаться ([0,0,90]) {
цилиндр (H = 3, R = 7);
}
}
}
}
}
}

Поскольку OpenSCAD, как правило, просто код, мы можем просто позвонить в этот модуль в соответствующей области в коде. Вы можете увидеть это в доработанном коде несколько прокрутков вниз. Идеально сейчас наша часть выглядит так: теперь единственное, что делегировало, добавить к этому, – это слот 3/8 «на первичном теле, а также несколько филе. Я покину филе как упражнение для читателя, однако вот код, а также фото для полученной части:

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.
Модуль вещь ()
{
разница(){
цилиндр (H = 7, R = 19);
цилиндр (H = 7, R = 8);
вращаться ([0,0,225]) {
Перевести ([0,1.5,0]) {
куб ([20,3,7]);
}
}
}
Перевести ([- 23,10,0]) {
CUBE ([46, 10, 7]);
}
Перевести ([- 10, -26,0]) {
куб ([20, 10, 7]);
}
Перевести ([0, -26,24]) {
фланец();
}
}

модуль фланец () {
вращаться ([270,0,180]) {
Перевести ([- 10,6, -4]) {
разница(){
Союз () {
куб ([20,12,4]);
Перевести ([10,0,0]) {
цилиндр (H = 4, R = 10);
}
}
Перевести ([10,0,0]) {
цилиндр (H = 4, R = 3,5);
вращаться ([0,0,90]) {
цилиндр (H = 3, R = 7);
}
}
}
}
}
}

предмет();

Так что вы идете. Вещь, произведенная с OpenSCAD. Это убедительное руководство по созданию вещей с OpenSCAD? Нет, однако это намного больше, чем достаточно, чтобы выпить ноги. Это достаточно, чтобы вы могли стилить свои собственные части, а также отправить их в 3D-принтер. На следующей неделе я сделаю то же самое дело в AutoCAD, что должно хорошо приравнивать к другим пакетам CAD. Если у вас есть какие-либо желания увидеть эту часть, сделанную с еще одним пакетом 3D стилей, оставьте ноту в комментариях.

Leave a Reply

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