Skip to content

Latest commit

 

History

History
337 lines (225 loc) · 5.58 KB

PITCHME.md

File metadata and controls

337 lines (225 loc) · 5.58 KB
marp
true

OpenSCAD v2021.01 Class

March 9, 2024

./cool_ball_wow.png


What We're Doing Today

  • Learn how to build 3D models on a computer
  • Learn how to print / cut them on the machines
  • Class assumes programming experience.

What Is OpenScad?

./keys.png


OpenSCAD Examples

"FoxDotBuild" on Github


What Is It?

  • 2D/3D CAD Designs from code
  • Non-interactive
  • Objects + Transformations = CAD design
  • Example: Subtract two cyliders


Why OpenSCAD

  • Parametric Designs: Serial numbers, keys, pipe adapters, QR Codes
  • Text is easy to automate, store, version, transform, etc..
  • Easily integrates into larger applications/scripts
  • Community driven and free
  • Light weight, runs in desktop or browser
  • Supports 3D and 2D CAD (laser cutter, 3D printer, X-Carve, etc..)

Disadvantages

  • Higher learning curve
  • Assumes computer programming experience:
    • loops
    • variables
    • modules / imports
  • You will forget to add semicolons, I promise.

Installation


Our First OpenSCAD Design

translate([0, 0, -10]) {
  circle(10);
};

sphere(r=10);

Color

translate([0,0,-10]) {
  color("green") {
    circle(10);
  };
};

translate([0,0,-10]) {
  color("blue") {
    circle(10);
  };
};

color("red") {
  sphere(r=10);
};

No Curly Braces

translate([0,0,-10]) color("blue") circle(10);

color("red") sphere(r=10);

Square / Cube / Cylinder

color("blue") square(12);
color("red") cube(10);
color("green") cube([8, 16, 24]);

Union / Difference / Intersection / Hull

Let's examine all four.

translate([0,20,0]) hull() {
  sphere(10);
  translate([-10, 0, 0]) sphere(10);
}
translate([0,0,0])  union() {
  sphere(10);
  translate([-10, 0, 0]) sphere(10);
}
translate([0,-40,0]) intersection() {
  sphere(10);
  translate([-10, 0, 0]) sphere(10);
}
translate([0,-20,0]) difference() {
  sphere(10);
  translate([-10, 0, 0]) sphere(10);
}

2D CAD

Example: Computer generated serial number tag / name tag.

difference() {
  square([48, 12]);
  translate([46, 10, 0]) circle(d = 2);
  translate([3, 3, 0]) text("01GS3TWM8KVFY9", size=3);
}

Variables and "Parametric" Design

"candleStand.scad" in File -> Examples


Special Variables, Part I

Variable Usage
$fa minimum angle
$fs minimum size
$fn number of fragments
$t animation step
$vpr viewport rotation angles in degrees

Special Variables, Part II

Variable Usage
$vpt viewport translation
$vpd viewport camera distance
$vpf viewport camera field of view
$children number of module children
$preview true in F5 preview, false for F6

Modifier Characters

Symbol Usage
# debug
% transparent
* disable
! show only

import("….stl")

  • See ducky.stl. Might crash the machine!!! Set $fn low!
$fn = 1;

import("ducky.stl");

Modules

File -> Examples -> Basics -> LetterBlock.scad

in OpenSCAD "Examples" section.

module pear(scale_factor = 50) {
  hull() {
    translate([0, 0, -(scale_factor*2)]) sphere(scale_factor * 2);
    sphere(scale_factor);
  }
}

pear(2);
translate([0, 9, 0]) pear(4);
translate([0, 24, 0]) pear(6);

Extrusion

rotate_extrude() translate([20, 0, 0]) circle(r = 10);
linear_extrude() translate([40, 0, 0]) circle(r = 10);

Minkowski Transform

  • Think of a Roomba.
minkowski() {
  cube([10,10,1]);
  cylinder(r=2,h=1);
}

Stuff I Did Not Cover

Now we will move on to higher-level topics.

Here are things you can research independently:

  • function
  • mirror
  • resize
  • rotate
  • scale
  • use

DXF Output: Laser Cut Your Design

Let's use the 2D esign from before.

  • Possible to produce 2D designs.
  • Usually DXF files.
  • Useful for plates, serial numbers, etc...

STL Output: 3D Printing your Design

  • What is GCode?
  • What is "Slicing"?

Exploring the Settings Menu

Let's take a look.


Other Resources


Exercise

  • Build a pipe that can be customized via the customizer:
    • Pipe length
    • Pipe outter diameter
    • Pipe inner diameter
    • Color

Thanks!