SlideShare une entreprise Scribd logo
1  sur  46
3D Design with OpenSCAD
Vicky Somma
vicky@tgaw.com
@TGAW
http://tgaw.wordpress.com
http://www.Shapeways.com/shops/tgaw
This presentation is on SlideShare at:
http://www.slideshare.net/VickyTGAW/3d-design-with-openscad
OpenSCAD – Download
• Free 3D Modeling Software
• Available for Windows, Linux, and MacOS
• Good at “clean” models (taking some of
worry out of the process– you can be
oblivious to “non-manifold” and “bad
face normals”)
• Because it’s instruction-base, it’s easy to
visualize measurements and come back
and tweak it
http://www.openscad.org/downloads.html
OpenSCAD – User Manual
Don’t Be Intimidated!
You Don’t Have to Memorize the Syntax!
Online User Manual
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual
Quick Cheat Sheet
http://www.openscad.org/cheatsheet/
OpenSCAD – Anatomy of User Interface
Text Editor – Where we put our
instructions (“code”)
Viewing Area – Your handiwork!
Renders of the model.
Console – Technical information
about what’s going on (progress
on rendering, any error
messages)
OpenSCAD – Text Editor Commands
Icons to create new files, save, undo, redo, indent,
preview, render, and most importantly for 3D Printing--
export to STL format.
OpenSCAD – Text Editor to Viewing Area
To see how your work looks, you can:
• Use Preview ( ) or Render ( ) icons
• Use the Design->Preview or Design->Render menu options
• Or the fastest option - use F5 for Preview and F6 for Render
OpenSCAD – Viewing Area Commands
Commands for Viewing, Rendering, Zooming In, Changing Views, Turning On or Off
Axis and Measurements Display, Showing Edges Versus Faces
OpenSCAD – The Mouse & the Viewing Area
• Left clicking and dragging allows you to rotate your view
• Right clicking and dragging pans the view
• Scroll wheel allows you to zoom in and out
OpenSCAD – Syntax Common Themes
• ; - The end of an instruction (ie make a cube;)
• // - A comment or label– for your purposes– will be ignored by the
viewing area
• { } - Grouping of commands
• [x,y,z] – “Vectors” (Coordinates, 3D sizes)
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General
OpenSCAD – Primitive Objects – Cube
cube([10,10,10]); cube([10,20,30]);cube([x, y, z]);
Draws 3D boxes
Not necessarily perfect
cubes – you can make
rectangles with it as well.
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#cube
OpenSCAD – Primitive Objects – Cylinder
cylinder(r=10,h=22);
cylinder(r1=10,r2=3,h=22);
cylinder(r=x,h=z);
cylinder(r1=x,r2=y,h=z);
Draws cylinders – and not
necessarily perfect
cylinders
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#cylinder
OpenSCAD – Primitive Objects – Cylinder
cylinder(r1=9, r2=0, h=9, $fn=4);
$fn parameter controls # of fragments
Increase– you can make really smooth objects
Decrease it– you can make Triangles, Pentagons, Pyramids, etc.
cylinder(r=9,$fn=3);cylinder(r=9,h=10,$fn=300);
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#cylinder
OpenSCAD – Primitive Objects – Sphere
sphere(d=22); sphere(d=22, $fn=100);sphere(d=x);
Draws spheres – and you can
control resolution
$fn parameter controls how
smooth it looks
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#sphere
OpenSCAD – Primitive Objects
You can build a lot out of standard shapes
OpenSCAD – Primitive Objects
You can build a lot out of these standard shapes- “Bipedal Mech” by Mathew Ridge
http://shpws.me/GQX5
OpenSCAD – 2D Objects - Text
text("TGAW");
Text(“x”);
Draws text. Text is great for customizing your models, engraving,
and embossing.
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text
OpenSCAD – 2D Objects - Text
Text(“x”, Font=“Font Name”);
Since OpenSCAD is installed on your machine, you can use any font already on your machine!
text("TGAW", font="Rockwell Extra Bold");
text("TGAW", font="Old English Text MT");
text("TGAW", font="Wingdings");
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text
OpenSCAD – 2D Objects - Polygons
polygon([[-24,0],[0,0],[0,32]
,[-16,32],[-15,28],[-13,24]
,[-12,20],[-12,15],[-13,10]
,[-15,6],[-19,3]]);
Polygon([x1,y1],[x2,y2],etc);
You specify the points to make
customized shapes (which you can
then extrude to 3D if needed)
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_Primitives#polygon
OpenSCAD – 2D Objects - Polygons
Need visual help making
Polygons?
http://daid.eu/~daid/3d
A graphical interface that
builds your polygon code for
you.
OpenSCAD – 2D to 3D
linear_extrude(height = 10)
polygon([[-24,0],[0,0],[0,32],[-16,32]
,[-15,28],[-13,24],[-12,20],[-12,15]
,[-13,10],[-15,6],[-19,3]]);
Linear_Extrude(height=x)
Makes your 2D object (circle, square, polygon) 3D
It can even twist the object as it grows up
NO SEMICOLON AFTER IT
(It’s not the end of the statement– we have to tell it what to extrude)
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion#Linear_Extrude
OpenSCAD – 2D to 3D
linear_extrude(height = 20, center = false
, $fn = 100, twist=30)
text("TGAW");
Linear_Extrude(height=x, twist=degrees)
Works on text and you can do fancy stuff like twisting
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion#Linear_Extrude
OpenSCAD – 2D to 3D
rotate_extrude(convexity = 10, $fn=300)
polygon([[-24,0],[0,0],[0,32],[-16,32],[-15,28]
,[13,24],[-12,20],[-12,15],[-13,10]
,[-15,6],[-19,3]]);
Rotate_Extrude()
Your 2D object (circle,
square, polygon) is rotated
around to make a 3D object
(like a cross section)
NO SEMICOLON AFTER IT
It’s not the end of the statement-- we need to tell it
what to extrude.
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion#Rotate_Extrude
OpenSCAD – Import STL
import("C:DownloadsVT.stl",convexity=10);
import(filepath, convexity=10);
The import function lets you bring in
existing 3D models into your project.
Note: In Your filepath, backslashes need to be doubled.
C:DownloadsMyStl.stl -> C:DownloadsMyStl.stl
Tip: If you are using other people’s models, be sure to
check and respect their licensing
(http://www.thingiverse.com/thing:818805 by GlynnLo)
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Importing_Geometry
OpenSCAD Basics – Transformations - Translate
cube([22,22,5]);
sphere(d=22, $fn=100);
cube([22,22,5]);
translate([11,11,0])
sphere(d=22, $fn=100);
translate([x,y,z])
Translate MOVES objects– lets you
define the how far to move along
each of the axes.
NO SEMICOLON AFTER IT
(It’s not the end of the statement– we have to tell it what to translate)
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate
OpenSCAD – Transformations – Rotate
rotate([x,y,z])
Rotate angles the object.
Guide to the axis is in your preview panel
NO SEMICOLON AFTER IT
(It’s not the end of the statement– we have to tell it what to rotate)
It’s Okay if you Need Some Trial and Error : )
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate
OpenSCAD - Transformations – Rotate
rotate([0,-45,0])
cube([22,22,5]);
rotate([0,0,30])
cube([22,22,5]);
rotate([x,y,z])
rotate([30,-45,30])
cube([22,22,5]);
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate
OpenSCAD - Transformations – Resize
resize([x,y,z],auto=true|false)
Resize allows you to make your object different
sizes where x, y, and z are your new dimensions
NO SEMICOLON AFTER IT
(It’s not the end of the statement– we have to tell it what to resize)
If auto=false, anything left zero stays the same.
If auto=true, anything left zero is sized proportionally. resize([200,0,10], auto=true)
import("VT.stl", convexity=10);
resize([200,0,10], auto=false)
import("VT.stl", convexity=10);
import("VT.stl", convexity=10);
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#resize
OpenSCAD – CSG Modeling
CSG stands for Constructive Solid Geometry.  You don’t need to remember that
Do Remember:
• Powerful!
• Combines your primitive parts/objects.
• Adding, Subtracting, Intersections
Credit: https://en.wikipedia.org/wiki/Constructive_solid_geometry#/media/File:Csg_tree.png
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling
OpenSCAD – CSG Modeling - Union
Adds objects into a one
union ()
{
object1;
object2;
}
union()
{
cube([5,10,5]);
translate([5,10,2.5])
{
rotate([0,-90,0])
cylinder(d=5, h=5, $fn=30);
}
translate([5,0,2.5])
{
rotate([0,-90,0])
cylinder(d=5, h=5, $fn=30);
}
}
Two cylinders and a cube
After union – single rounded object
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#union
OpenSCAD – CSG Modeling - Difference
Subtracts objects from each other
difference ()
{
object1;
object2;
}
difference()
{
cube([5,10,5]);
translate([5.5,10,2.5])
{
rotate([0,-90,0])
cylinder(d=5, h=6, $fn=30);
}
translate([5.5,-1,2.5])
{
rotate([0,-90,0])
cylinder(d=5, h=6, $fn=30);
}
}
Two cylinders and a cube
After “subtracting” the cylinders from
the cube
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#difference
OpenSCAD – CSG Modeling - Difference
Practical Use of Difference – Engraving Text!
difference()
{
cube([5,10,5]);
translate([5.5,10,2.5])
{
rotate([0,-90,0])
cylinder(d=5, h=6, $fn=30);
}
translate([5.5,-1,2.5])
{
rotate([0,-90,0])
cylinder(d=5, h=6, $fn=30);
}
translate([2,6.5,0.5])
rotate([90,0,-90])
linear_extrude(height=2)
text("V", font="Old English Text MT", size=4);
}
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#difference
OpenSCAD – CSG Modeling - Intersection
Takes where both objects overlap
(like a Venn Diagram)
intersection ()
{
object1;
object2;
}
intersection()
{
cylinder(r=5,h=3);
translate([4,0,0])
cylinder(r=5, h=3);
}
Two cylinders
Intersection – an Almond Shape
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#intersection
OpenSCAD – CSG Modeling - Intersection
Practical Use of Intersection – Curving Details!
intersection()
{
sphere(r=9.25, $fn=100);
resize([0,0,11],auto=false)
resize([12,0,0], auto=true)
import("VT.stl", convexity=10);
}
A sphere and a VT Logo Intersection – A curved VT Logo
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#intersection
OpenSCAD – CSG Modeling - Combinations
Practical Use of Intersection – Curving Details!
union()
{
sphere(r=9, $fn=100);
intersection()
{
sphere(r=9.25, $fn=100);
resize([0,0,11],auto=false)
resize([12,0,0], auto=true)
import("VT.stl", convexity=10);
}
}
Add a slightly smaller sphere and we have a curved, embossed VT logo on a sphere.
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling
OpenSCAD – Advanced - Modules
To help readability and reusability, you can make modules.
module name()
{ //your code }
module base_sphere()
{
sphere(r=9, $fn=100);
}
module curved_VT()
{
intersection()
{
sphere(r=9.25, $fn=100);
resize([0,0,11],auto=false)
resize([12,0,0], auto=true)
import("VT.stl", convexity=10);
}
}
union()
{
base_sphere();
curved_VT();
}
union()
{
sphere(r=9, $fn=100);
intersection()
{
sphere(r=9.25, $fn=100);
resize([0,0,11],auto=false)
resize([12,0,0], auto=true)
import("VT.stl", convexity=10);
}
}
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modules
Fun Fact – All objects in a model are already merged into one, no
unions necessary
OpenSCAD – Advanced - Loops
Loops are powerful for repeated tasks
for ( i = [start : increment : end] )
{ //your code }
for (i=[0:5:15])
{
translate([i,0,0])
cylinder(r=1, h=15, $fn=36);
}
Translation– We are going to start at 0. Every 5 mm, draw a
cylinder until we reach 15mm.
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Conditional_and_Iterator_Functions#For_Loop
OpenSCAD – Advanced - Loops
“Nested Loops”
for ( i = [start : increment : end], j = [start : increment : end] )
{ //your code }
for (i=[0:5:15],j=[0:5:20])
{
translate([i,j,0])
cylinder(r=1, h=15, $fn=36);
}
Translation– We going to end up with 20 pegs in 4 columns
and 5 rows.
Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Conditional_and_Iterator_Functions#For_Loop
OpenSCAD – Troubleshooting
Having Unexpected Results?
• Check Your Syntax
(maybe there’s a semi colon after a translate)
• Check the Console for error messages (which would include a
line number)
OpenSCAD – Troubleshooting
• echo allows you to send details to the Console
• // allows you to comment out instructions so you can narrow
down the culprit
echo("i:", i, " j:", j);
OpenSCAD – Troubleshooting
• # allows you to have objects highlighted
difference()
{
cube([5,10,5]);
translate([5.5,10,2.5])
{
rotate([0,-90,0])
cylinder(d=5, h=6, $fn=30);
}
translate([5.5,-1,2.5])
{
#rotate([0,-90,0])
cylinder(d=5, h=6, $fn=30);
}
}
OpenSCAD – Saving and Exporting
• Be sure to Save your code often
• When you’re ready to print, you’ll want to Export to STL file.
• Pre-requisite– Do your official render (F6).
• The system will remind you. : )
OpenSCAD – Code Scavenging!
OpenSCAD even comes
with its OWN examples
which you can open,
review, and tweak to
meet your needs.
OpenSCAD – Code Scavenging!
Thingiverse has a OpenSCAD area full
of shared source code– just search
“OpenSCAD”
http://www.thingiverse.com/search?q
=OpenSCAD
You can download the final .STL file
AND the original .SCAD files, so you
can read and find out how it was
made.
OpenSCAD – Code Scavenging!
• OpenSCAD Community Forums
http://www.openscad.org/community.html
• OpenSCAD reddit
http://www.reddit.com/r/OpenSCAD/
• Good ole Google
OpenSCAD – OpenJSCAD
http://openjscad.org
• Web-based
• Has its own JavaScript, object-oriented
language
• BUT 95% of the OpenSCAD Language is
supported
Quick Tips
• User Guide at
https://github.com/Spiritdude/OpenJSCAD.org/wiki/User-Guide
• //!OpenSCAD at the top tells it you’re using OpenSCAD
• Shift-Enter in the “Text Editor” renders
• Holding down the Left or Right Mouse Button lets you rotate the
View Pane
• Holding down Shift Left Mouse Button lets you pan in the View Pane
THANK YOU!!!
https://twitter.com/tgaw
http://tgaw.wordpress.com
http://www.shapeways.com/shops/tgaw
http://www.instructables.com/member/VickyTGAW
http://instagram.com/VickyTGAW
Vicky Somma
vicky@tgaw.com

Contenu connexe

Tendances

CSS3 2D/3D transform
CSS3 2D/3D transformCSS3 2D/3D transform
CSS3 2D/3D transform
Kenny Lee
 
AutoCAD 2014 Introduction
AutoCAD 2014 IntroductionAutoCAD 2014 Introduction
AutoCAD 2014 Introduction
TUOS-Sam
 

Tendances (20)

CSS3 2D/3D transform
CSS3 2D/3D transformCSS3 2D/3D transform
CSS3 2D/3D transform
 
Js ppt
Js pptJs ppt
Js ppt
 
Autocad 2015 (best presentation)
Autocad 2015 (best presentation)Autocad 2015 (best presentation)
Autocad 2015 (best presentation)
 
3D Transformation
3D Transformation 3D Transformation
3D Transformation
 
Lesson 3 motion tween
Lesson 3 motion tweenLesson 3 motion tween
Lesson 3 motion tween
 
Google sketch up
Google sketch upGoogle sketch up
Google sketch up
 
CSS
CSSCSS
CSS
 
Web development ppt
Web development pptWeb development ppt
Web development ppt
 
AutoCAD 2014 Introduction
AutoCAD 2014 IntroductionAutoCAD 2014 Introduction
AutoCAD 2014 Introduction
 
Adobe XD
Adobe XD Adobe XD
Adobe XD
 
Web design principles
Web design principlesWeb design principles
Web design principles
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Javascript
JavascriptJavascript
Javascript
 
computer language - Html frames
computer language - Html framescomputer language - Html frames
computer language - Html frames
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
 
Auto CADD civil
Auto CADD civilAuto CADD civil
Auto CADD civil
 
LESSON 2 - Flash Animation
LESSON 2 - Flash AnimationLESSON 2 - Flash Animation
LESSON 2 - Flash Animation
 
Ppt autocad
Ppt autocadPpt autocad
Ppt autocad
 
Modeling for 3D Printing with Tinkercad
Modeling for 3D Printing with TinkercadModeling for 3D Printing with Tinkercad
Modeling for 3D Printing with Tinkercad
 

En vedette

Tinkercad Tutorial- COM 250
Tinkercad Tutorial- COM 250Tinkercad Tutorial- COM 250
Tinkercad Tutorial- COM 250
kaytlynleonard
 
Presentación impresora 3d
Presentación impresora 3dPresentación impresora 3d
Presentación impresora 3d
marina_benabad92
 

En vedette (13)

3D Printing & Crafts
3D Printing & Crafts3D Printing & Crafts
3D Printing & Crafts
 
Open Scad presentation
Open Scad presentationOpen Scad presentation
Open Scad presentation
 
Impresoras 3D
Impresoras 3DImpresoras 3D
Impresoras 3D
 
Makerbot Objects from Thingiverse
Makerbot Objects from ThingiverseMakerbot Objects from Thingiverse
Makerbot Objects from Thingiverse
 
Nhà sản xuất máy in 3D, máy tạo mẫu nữ trang tại Việt Nam
Nhà sản xuất máy in 3D, máy tạo mẫu nữ trang tại Việt NamNhà sản xuất máy in 3D, máy tạo mẫu nữ trang tại Việt Nam
Nhà sản xuất máy in 3D, máy tạo mẫu nữ trang tại Việt Nam
 
Tinkercad Tutorial- COM 250
Tinkercad Tutorial- COM 250Tinkercad Tutorial- COM 250
Tinkercad Tutorial- COM 250
 
Tinkercad lesson 1
Tinkercad lesson 1Tinkercad lesson 1
Tinkercad lesson 1
 
Impresión de Órganos en 3D
Impresión de Órganos en 3DImpresión de Órganos en 3D
Impresión de Órganos en 3D
 
DIMA 3D - Introducción a la tecnología de impresión 3D
DIMA 3D - Introducción a la tecnología de impresión 3DDIMA 3D - Introducción a la tecnología de impresión 3D
DIMA 3D - Introducción a la tecnología de impresión 3D
 
Tinkercad tutorial pdf
Tinkercad tutorial pdfTinkercad tutorial pdf
Tinkercad tutorial pdf
 
Tinkercad
TinkercadTinkercad
Tinkercad
 
Presentación impresora 3d
Presentación impresora 3dPresentación impresora 3d
Presentación impresora 3d
 
Presentación de impresoras 3D 2.0
Presentación de impresoras 3D 2.0 Presentación de impresoras 3D 2.0
Presentación de impresoras 3D 2.0
 

Similaire à 3D Design with OpenSCAD

3D Presentation AU 2014 (abridged)
3D Presentation AU 2014 (abridged)3D Presentation AU 2014 (abridged)
3D Presentation AU 2014 (abridged)
William Work
 

Similaire à 3D Design with OpenSCAD (20)

Agile data visualisation
Agile data visualisationAgile data visualisation
Agile data visualisation
 
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
 
Esoteric, Obfuscated, Artistic Programming in Ruby
Esoteric, Obfuscated, Artistic Programming in RubyEsoteric, Obfuscated, Artistic Programming in Ruby
Esoteric, Obfuscated, Artistic Programming in Ruby
 
CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35
 
Solid Works
Solid WorksSolid Works
Solid Works
 
Product design solidworks training ppt
Product design  solidworks training pptProduct design  solidworks training ppt
Product design solidworks training ppt
 
AutoCAD Productivity Hacks for Engineers, Architects, Designers, and Draftsme...
AutoCAD Productivity Hacks for Engineers, Architects, Designers, and Draftsme...AutoCAD Productivity Hacks for Engineers, Architects, Designers, and Draftsme...
AutoCAD Productivity Hacks for Engineers, Architects, Designers, and Draftsme...
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to Coding
 
Creating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector GraphicsCreating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector Graphics
 
3. Brochure ZWCAD.pdf
3. Brochure ZWCAD.pdf3. Brochure ZWCAD.pdf
3. Brochure ZWCAD.pdf
 
Top 10 New Features in SOLIDWORKS 2019 - 3D CAD
Top 10 New Features in SOLIDWORKS 2019 - 3D CADTop 10 New Features in SOLIDWORKS 2019 - 3D CAD
Top 10 New Features in SOLIDWORKS 2019 - 3D CAD
 
SOLIDWORKS World 2016 - Sketching Tips From A SOLIDWORKS Guru
SOLIDWORKS World 2016 - Sketching Tips From A SOLIDWORKS GuruSOLIDWORKS World 2016 - Sketching Tips From A SOLIDWORKS Guru
SOLIDWORKS World 2016 - Sketching Tips From A SOLIDWORKS Guru
 
Autocad Prsentation
Autocad PrsentationAutocad Prsentation
Autocad Prsentation
 
SVG (Devoxx 2011, 2011-NOV-14)
SVG (Devoxx 2011, 2011-NOV-14)SVG (Devoxx 2011, 2011-NOV-14)
SVG (Devoxx 2011, 2011-NOV-14)
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
 
Auto cad ppt
Auto cad pptAuto cad ppt
Auto cad ppt
 
3D Presentation AU 2014 (abridged)
3D Presentation AU 2014 (abridged)3D Presentation AU 2014 (abridged)
3D Presentation AU 2014 (abridged)
 
GDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSGDayX - Advanced Angular.JS
GDayX - Advanced Angular.JS
 
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5
 
3D Modeling Tour
3D Modeling Tour3D Modeling Tour
3D Modeling Tour
 

Plus de VickyTGAW

Plus de VickyTGAW (11)

Troubleshooting - 2022-December.pptx
Troubleshooting - 2022-December.pptxTroubleshooting - 2022-December.pptx
Troubleshooting - 2022-December.pptx
 
FCPL 2022.pptx
FCPL 2022.pptxFCPL 2022.pptx
FCPL 2022.pptx
 
Slicing with Cura - 2022.pptx
Slicing with Cura - 2022.pptxSlicing with Cura - 2022.pptx
Slicing with Cura - 2022.pptx
 
Slicing with Cura - 2022
Slicing with Cura - 2022Slicing with Cura - 2022
Slicing with Cura - 2022
 
Troubleshooting - 2022
Troubleshooting - 2022Troubleshooting - 2022
Troubleshooting - 2022
 
3D Printing, Tinkercad, Cura
3D Printing, Tinkercad, Cura3D Printing, Tinkercad, Cura
3D Printing, Tinkercad, Cura
 
Machine Maintenance and Troubleshooting
Machine Maintenance and TroubleshootingMachine Maintenance and Troubleshooting
Machine Maintenance and Troubleshooting
 
Slicing Troubleshooting with Cura
Slicing Troubleshooting with CuraSlicing Troubleshooting with Cura
Slicing Troubleshooting with Cura
 
Blender and Bezier Curves for 3D Printing
Blender and Bezier Curves for 3D PrintingBlender and Bezier Curves for 3D Printing
Blender and Bezier Curves for 3D Printing
 
MakerFaireNova - 3D Printing Without Owning a 3D Printer
MakerFaireNova - 3D Printing Without Owning a 3D PrinterMakerFaireNova - 3D Printing Without Owning a 3D Printer
MakerFaireNova - 3D Printing Without Owning a 3D Printer
 
Jimmie's Views - Excerpts of a Hiking Dog's Adventures
Jimmie's Views - Excerpts of a Hiking Dog's AdventuresJimmie's Views - Excerpts of a Hiking Dog's Adventures
Jimmie's Views - Excerpts of a Hiking Dog's Adventures
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

3D Design with OpenSCAD

  • 1. 3D Design with OpenSCAD Vicky Somma vicky@tgaw.com @TGAW http://tgaw.wordpress.com http://www.Shapeways.com/shops/tgaw This presentation is on SlideShare at: http://www.slideshare.net/VickyTGAW/3d-design-with-openscad
  • 2. OpenSCAD – Download • Free 3D Modeling Software • Available for Windows, Linux, and MacOS • Good at “clean” models (taking some of worry out of the process– you can be oblivious to “non-manifold” and “bad face normals”) • Because it’s instruction-base, it’s easy to visualize measurements and come back and tweak it http://www.openscad.org/downloads.html
  • 3. OpenSCAD – User Manual Don’t Be Intimidated! You Don’t Have to Memorize the Syntax! Online User Manual https://en.wikibooks.org/wiki/OpenSCAD_User_Manual Quick Cheat Sheet http://www.openscad.org/cheatsheet/
  • 4. OpenSCAD – Anatomy of User Interface Text Editor – Where we put our instructions (“code”) Viewing Area – Your handiwork! Renders of the model. Console – Technical information about what’s going on (progress on rendering, any error messages)
  • 5. OpenSCAD – Text Editor Commands Icons to create new files, save, undo, redo, indent, preview, render, and most importantly for 3D Printing-- export to STL format.
  • 6. OpenSCAD – Text Editor to Viewing Area To see how your work looks, you can: • Use Preview ( ) or Render ( ) icons • Use the Design->Preview or Design->Render menu options • Or the fastest option - use F5 for Preview and F6 for Render
  • 7. OpenSCAD – Viewing Area Commands Commands for Viewing, Rendering, Zooming In, Changing Views, Turning On or Off Axis and Measurements Display, Showing Edges Versus Faces
  • 8. OpenSCAD – The Mouse & the Viewing Area • Left clicking and dragging allows you to rotate your view • Right clicking and dragging pans the view • Scroll wheel allows you to zoom in and out
  • 9. OpenSCAD – Syntax Common Themes • ; - The end of an instruction (ie make a cube;) • // - A comment or label– for your purposes– will be ignored by the viewing area • { } - Grouping of commands • [x,y,z] – “Vectors” (Coordinates, 3D sizes) Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General
  • 10. OpenSCAD – Primitive Objects – Cube cube([10,10,10]); cube([10,20,30]);cube([x, y, z]); Draws 3D boxes Not necessarily perfect cubes – you can make rectangles with it as well. Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#cube
  • 11. OpenSCAD – Primitive Objects – Cylinder cylinder(r=10,h=22); cylinder(r1=10,r2=3,h=22); cylinder(r=x,h=z); cylinder(r1=x,r2=y,h=z); Draws cylinders – and not necessarily perfect cylinders Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#cylinder
  • 12. OpenSCAD – Primitive Objects – Cylinder cylinder(r1=9, r2=0, h=9, $fn=4); $fn parameter controls # of fragments Increase– you can make really smooth objects Decrease it– you can make Triangles, Pentagons, Pyramids, etc. cylinder(r=9,$fn=3);cylinder(r=9,h=10,$fn=300); Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#cylinder
  • 13. OpenSCAD – Primitive Objects – Sphere sphere(d=22); sphere(d=22, $fn=100);sphere(d=x); Draws spheres – and you can control resolution $fn parameter controls how smooth it looks Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#sphere
  • 14. OpenSCAD – Primitive Objects You can build a lot out of standard shapes
  • 15. OpenSCAD – Primitive Objects You can build a lot out of these standard shapes- “Bipedal Mech” by Mathew Ridge http://shpws.me/GQX5
  • 16. OpenSCAD – 2D Objects - Text text("TGAW"); Text(“x”); Draws text. Text is great for customizing your models, engraving, and embossing. Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text
  • 17. OpenSCAD – 2D Objects - Text Text(“x”, Font=“Font Name”); Since OpenSCAD is installed on your machine, you can use any font already on your machine! text("TGAW", font="Rockwell Extra Bold"); text("TGAW", font="Old English Text MT"); text("TGAW", font="Wingdings"); Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text
  • 18. OpenSCAD – 2D Objects - Polygons polygon([[-24,0],[0,0],[0,32] ,[-16,32],[-15,28],[-13,24] ,[-12,20],[-12,15],[-13,10] ,[-15,6],[-19,3]]); Polygon([x1,y1],[x2,y2],etc); You specify the points to make customized shapes (which you can then extrude to 3D if needed) Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_Primitives#polygon
  • 19. OpenSCAD – 2D Objects - Polygons Need visual help making Polygons? http://daid.eu/~daid/3d A graphical interface that builds your polygon code for you.
  • 20. OpenSCAD – 2D to 3D linear_extrude(height = 10) polygon([[-24,0],[0,0],[0,32],[-16,32] ,[-15,28],[-13,24],[-12,20],[-12,15] ,[-13,10],[-15,6],[-19,3]]); Linear_Extrude(height=x) Makes your 2D object (circle, square, polygon) 3D It can even twist the object as it grows up NO SEMICOLON AFTER IT (It’s not the end of the statement– we have to tell it what to extrude) Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion#Linear_Extrude
  • 21. OpenSCAD – 2D to 3D linear_extrude(height = 20, center = false , $fn = 100, twist=30) text("TGAW"); Linear_Extrude(height=x, twist=degrees) Works on text and you can do fancy stuff like twisting Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion#Linear_Extrude
  • 22. OpenSCAD – 2D to 3D rotate_extrude(convexity = 10, $fn=300) polygon([[-24,0],[0,0],[0,32],[-16,32],[-15,28] ,[13,24],[-12,20],[-12,15],[-13,10] ,[-15,6],[-19,3]]); Rotate_Extrude() Your 2D object (circle, square, polygon) is rotated around to make a 3D object (like a cross section) NO SEMICOLON AFTER IT It’s not the end of the statement-- we need to tell it what to extrude. Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion#Rotate_Extrude
  • 23. OpenSCAD – Import STL import("C:DownloadsVT.stl",convexity=10); import(filepath, convexity=10); The import function lets you bring in existing 3D models into your project. Note: In Your filepath, backslashes need to be doubled. C:DownloadsMyStl.stl -> C:DownloadsMyStl.stl Tip: If you are using other people’s models, be sure to check and respect their licensing (http://www.thingiverse.com/thing:818805 by GlynnLo) Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Importing_Geometry
  • 24. OpenSCAD Basics – Transformations - Translate cube([22,22,5]); sphere(d=22, $fn=100); cube([22,22,5]); translate([11,11,0]) sphere(d=22, $fn=100); translate([x,y,z]) Translate MOVES objects– lets you define the how far to move along each of the axes. NO SEMICOLON AFTER IT (It’s not the end of the statement– we have to tell it what to translate) Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate
  • 25. OpenSCAD – Transformations – Rotate rotate([x,y,z]) Rotate angles the object. Guide to the axis is in your preview panel NO SEMICOLON AFTER IT (It’s not the end of the statement– we have to tell it what to rotate) It’s Okay if you Need Some Trial and Error : ) Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate
  • 26. OpenSCAD - Transformations – Rotate rotate([0,-45,0]) cube([22,22,5]); rotate([0,0,30]) cube([22,22,5]); rotate([x,y,z]) rotate([30,-45,30]) cube([22,22,5]); Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate
  • 27. OpenSCAD - Transformations – Resize resize([x,y,z],auto=true|false) Resize allows you to make your object different sizes where x, y, and z are your new dimensions NO SEMICOLON AFTER IT (It’s not the end of the statement– we have to tell it what to resize) If auto=false, anything left zero stays the same. If auto=true, anything left zero is sized proportionally. resize([200,0,10], auto=true) import("VT.stl", convexity=10); resize([200,0,10], auto=false) import("VT.stl", convexity=10); import("VT.stl", convexity=10); Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#resize
  • 28. OpenSCAD – CSG Modeling CSG stands for Constructive Solid Geometry.  You don’t need to remember that Do Remember: • Powerful! • Combines your primitive parts/objects. • Adding, Subtracting, Intersections Credit: https://en.wikipedia.org/wiki/Constructive_solid_geometry#/media/File:Csg_tree.png Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling
  • 29. OpenSCAD – CSG Modeling - Union Adds objects into a one union () { object1; object2; } union() { cube([5,10,5]); translate([5,10,2.5]) { rotate([0,-90,0]) cylinder(d=5, h=5, $fn=30); } translate([5,0,2.5]) { rotate([0,-90,0]) cylinder(d=5, h=5, $fn=30); } } Two cylinders and a cube After union – single rounded object Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#union
  • 30. OpenSCAD – CSG Modeling - Difference Subtracts objects from each other difference () { object1; object2; } difference() { cube([5,10,5]); translate([5.5,10,2.5]) { rotate([0,-90,0]) cylinder(d=5, h=6, $fn=30); } translate([5.5,-1,2.5]) { rotate([0,-90,0]) cylinder(d=5, h=6, $fn=30); } } Two cylinders and a cube After “subtracting” the cylinders from the cube Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#difference
  • 31. OpenSCAD – CSG Modeling - Difference Practical Use of Difference – Engraving Text! difference() { cube([5,10,5]); translate([5.5,10,2.5]) { rotate([0,-90,0]) cylinder(d=5, h=6, $fn=30); } translate([5.5,-1,2.5]) { rotate([0,-90,0]) cylinder(d=5, h=6, $fn=30); } translate([2,6.5,0.5]) rotate([90,0,-90]) linear_extrude(height=2) text("V", font="Old English Text MT", size=4); } Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#difference
  • 32. OpenSCAD – CSG Modeling - Intersection Takes where both objects overlap (like a Venn Diagram) intersection () { object1; object2; } intersection() { cylinder(r=5,h=3); translate([4,0,0]) cylinder(r=5, h=3); } Two cylinders Intersection – an Almond Shape Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#intersection
  • 33. OpenSCAD – CSG Modeling - Intersection Practical Use of Intersection – Curving Details! intersection() { sphere(r=9.25, $fn=100); resize([0,0,11],auto=false) resize([12,0,0], auto=true) import("VT.stl", convexity=10); } A sphere and a VT Logo Intersection – A curved VT Logo Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#intersection
  • 34. OpenSCAD – CSG Modeling - Combinations Practical Use of Intersection – Curving Details! union() { sphere(r=9, $fn=100); intersection() { sphere(r=9.25, $fn=100); resize([0,0,11],auto=false) resize([12,0,0], auto=true) import("VT.stl", convexity=10); } } Add a slightly smaller sphere and we have a curved, embossed VT logo on a sphere. Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling
  • 35. OpenSCAD – Advanced - Modules To help readability and reusability, you can make modules. module name() { //your code } module base_sphere() { sphere(r=9, $fn=100); } module curved_VT() { intersection() { sphere(r=9.25, $fn=100); resize([0,0,11],auto=false) resize([12,0,0], auto=true) import("VT.stl", convexity=10); } } union() { base_sphere(); curved_VT(); } union() { sphere(r=9, $fn=100); intersection() { sphere(r=9.25, $fn=100); resize([0,0,11],auto=false) resize([12,0,0], auto=true) import("VT.stl", convexity=10); } } Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modules Fun Fact – All objects in a model are already merged into one, no unions necessary
  • 36. OpenSCAD – Advanced - Loops Loops are powerful for repeated tasks for ( i = [start : increment : end] ) { //your code } for (i=[0:5:15]) { translate([i,0,0]) cylinder(r=1, h=15, $fn=36); } Translation– We are going to start at 0. Every 5 mm, draw a cylinder until we reach 15mm. Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Conditional_and_Iterator_Functions#For_Loop
  • 37. OpenSCAD – Advanced - Loops “Nested Loops” for ( i = [start : increment : end], j = [start : increment : end] ) { //your code } for (i=[0:5:15],j=[0:5:20]) { translate([i,j,0]) cylinder(r=1, h=15, $fn=36); } Translation– We going to end up with 20 pegs in 4 columns and 5 rows. Reference: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Conditional_and_Iterator_Functions#For_Loop
  • 38. OpenSCAD – Troubleshooting Having Unexpected Results? • Check Your Syntax (maybe there’s a semi colon after a translate) • Check the Console for error messages (which would include a line number)
  • 39. OpenSCAD – Troubleshooting • echo allows you to send details to the Console • // allows you to comment out instructions so you can narrow down the culprit echo("i:", i, " j:", j);
  • 40. OpenSCAD – Troubleshooting • # allows you to have objects highlighted difference() { cube([5,10,5]); translate([5.5,10,2.5]) { rotate([0,-90,0]) cylinder(d=5, h=6, $fn=30); } translate([5.5,-1,2.5]) { #rotate([0,-90,0]) cylinder(d=5, h=6, $fn=30); } }
  • 41. OpenSCAD – Saving and Exporting • Be sure to Save your code often • When you’re ready to print, you’ll want to Export to STL file. • Pre-requisite– Do your official render (F6). • The system will remind you. : )
  • 42. OpenSCAD – Code Scavenging! OpenSCAD even comes with its OWN examples which you can open, review, and tweak to meet your needs.
  • 43. OpenSCAD – Code Scavenging! Thingiverse has a OpenSCAD area full of shared source code– just search “OpenSCAD” http://www.thingiverse.com/search?q =OpenSCAD You can download the final .STL file AND the original .SCAD files, so you can read and find out how it was made.
  • 44. OpenSCAD – Code Scavenging! • OpenSCAD Community Forums http://www.openscad.org/community.html • OpenSCAD reddit http://www.reddit.com/r/OpenSCAD/ • Good ole Google
  • 45. OpenSCAD – OpenJSCAD http://openjscad.org • Web-based • Has its own JavaScript, object-oriented language • BUT 95% of the OpenSCAD Language is supported Quick Tips • User Guide at https://github.com/Spiritdude/OpenJSCAD.org/wiki/User-Guide • //!OpenSCAD at the top tells it you’re using OpenSCAD • Shift-Enter in the “Text Editor” renders • Holding down the Left or Right Mouse Button lets you rotate the View Pane • Holding down Shift Left Mouse Button lets you pan in the View Pane