union

``````radius = 10;

``````

``````radius = 10;

}

rotate(-45)
``````

``````radius = 10;

rotate(-45) union() {
}
``````

``````radius = 10;

rotated_angle = 45;
\$fn = 48;

rotate(-rotated_angle) union() {
square(diameter);
}

translate([cos(rotated_angle) * diameter, 0, 0])
}

``````

difference

`difference` 就是對模型做差集，也就是對模型做減法運算，舉個例子來說，你也許會想在愛心上刻個鏤空字：

``````radius = 20;

rotated_angle = 45;
\$fn = 48;

rotate(-rotated_angle) union() {
square(diameter);
}

translate([cos(rotated_angle) * diameter, 0, 0])
}

difference() {
text("LOVE");
}
``````

intersection

`intersection` 是做模型的交集，也就是兩個模型間彼此有接觸的部份，才可以保留下來，舉個例子來說，如何做一個球面字呢？你可以用 `sphere` 建立一大一小的立體球先做 `difference`，這樣就會是個空心球，接著，建立一個文字並用 `linear_extrude` 拉高，與空心球做交集…

``````character = "A";
font_size = 10;
thickness = 1;

\$fn = 48;

difference() {
}
}

module sphere_character(ch, font_size, thickness) {
font_offset = font_size / 2;

intersection() {
hollow_sphere(font_size, thickness);
linear_extrude(font_size * 2)
translate([-font_offset, -font_offset, 0])
text(ch, size = font_size);
}
}

sphere_character(character[0], font_size, thickness);
sphere(font_size - thickness, \$fn = 48);
``````

hull

`hull` 是列在〈OpenSCAD CheatSheet〉的 Transformations，乍看不是很清楚它的意義，hull 的意思是「殼」，從這方面來想，就是為你的模型建立一個「殼」，這麼想好了，如果你的模型是 2D，那麼 `hull` 會為這些模型拉一條繃緊的線圍起來，在線內的就是 `hull` 建立的模型，例如，底下建立兩個圓：

``````radius = 10;
``````

``````radius = 10;
hull() {
}
``````

``````radius = 10;
hull() {
linear_extrude(10)