SlideShare a Scribd company logo
1 of 27
Download to read offline
OpenSCAD Tutorial
John Oliva - 2/22/17
Intro
What is OpenSCAD?
● 3D modeling program based on constructive solid
geometry
● Dynamically typed language
● Open Source: https://github.com/openscad/openscad
● Windows, Mac OS X, Linux (14 - 23 MB), web app
(openscad.net)
● GUI or CLI usage
Intro
Why OpenSCAD?
● Free to obtain and for commercial use
● Parametric - easy to adjust object to customize use
● Simple language
● Large amount of existing code freely available (Github,
Thingiverse, etc.)
● Large user community
● Well established - been around since 2010
● Produces solid, watertight 3D objects
● Good online documentation
Intro
Differentiators from other 3D CAD?
● Declarative, procedure oriented programming
● Interactive design - but not by interacting directly with
rendered model on screen
● Customizers
○ Thingiverse
○ Built into development version of OpenSCAD
● Computational generation of shapes (e.g. fractal shaped
object)
Resources
● www.openscad.org
● cheatsheet: www.openscad.org/cheatsheet
● manual: en.wikibooks.org/wiki/OpenSCAD_User_Manual
● Libraries
○ OpenSCAD general library of relativity
■ github.com/davidson16807/relativity.scad/wiki
■ www.thingiverse.com/thing:349943
○ MCAD library
■ github.com/openscad/MCAD
■ Lots of resources for mechanical design
● Alternative language interfaces
○ SolidPython: github.com/SolidCode/SolidPython
○ OpenJSCAD: openjscad.org
● Web based OpenSCAD: openscad.net
Installation
● www.openscad.org/downloads.html
● Latest stable releases
○ Mac OS X: 2015.03-3
○ Windows: 2015.03-2
○ Linux: 2015.03-2
● Much more recent development snapshots
Quick GUI Overview
● Preview/Render pane
● Code pane
○ detachable
○ supports external editor (Design->Automatic Reload and Preview)
● Console pane
○ detachable
● Customizer pane
○ detachable
○ not currently available in stables releases
Workflow
● Iterate (until happy with design)
○ Write OpenSCAD code
○ Preview using F5 (generates CSG representation for OpenGL
rendering)
● Render to full geometry using F6 (generates CGAL
representation, surfaces, edges, vertices)
● Export to a format for import into subsequent tool
○ e.g. STL for import into siicer
○ export formats: STL, OFF, AMF, DXF, SVG, CSG, PNG
Concepts - 2D Shapes
● Circle
● Square (actually rectangle)
● Polygon
● Text
Concepts - 3D Shapes
● Cube (actually rectangular prism)
● Sphere
● Cylinder (or cone)
Concepts - Transforms
● Translate
● Scale
● Rotate
● Mirror
● Color
● Others: resize, multmatrix, offset, hull, minkowski
Concepts - Boolean Operations
● Union
○ combines multiple shapes into a single object
● Difference
○ removes/subtracts second and remaining shapes from the first
shape
● Intersection
○ leaves the parts that are common to all of the shapes included
Concepts - Extrusions
● Linear
○ extends a 2D object in the X/Y plane in the Z direction
● Rotational
○ rotates a 2D object defined in the X/Y plane around the Z axis
Concepts - Surface
● Creates a 3D object from:
○ height map data file
○ PNG image where grayscale indicates height
○ Can be used to create a lithophane
Examples
● Cup
● Customizer: Lego block
Language - Comments
● line: //
● block: /* */
Language - Console logging
● echo (aa,bb,cc,dd);
● echo (var=var);
Language - Types
● No declaration required
● Numbers (integer, floating point)
● Boolean (true/false)
● String
● Vector
● Undefined (undef)
Language - Variables
● variable_name = expression
● Variable values at calculated at compile-time, not run-time
● Special variables - start with $
○ $fa minimum angle
○ $fs minimum size
○ $fn minimum # of fragments
○ $t animation step
○ Others: $vpr, $vpt, $vpd
Language - Operators
● arithmetic: *, /, +, -, %
● relational: <, >, <=, >=, ==, !=
● logical: &&, ||, !
● conditional: exp ? val1 : val2
● vector: +, -
Language - List Comprehensions
● Used to generate a list
● Examples
○ Squares: squares = [ for(i=[0:10]) i*i ]; echo (squares);
○ Divisible by 3: div3 = [ for(i=[0:20]) if (i%3 == 0) i ]; echo (div3);
Language - Modules
● Operates like a subroutine in other languages and does
not return a value
● Most often used for constructing higher order 2D or 3D
objects from simpler ones
● Format: module name (comma_sep_param_list) { … }
Language - Functions
● Operates like a function in other languages although
defined as a single expression returning a value
● Most often used for constructing higher order 2D or 3D
objects from simpler ones
● Format: function name (params) = expression yielding a
value
● Example - Factorial
function factorial(n) = ( n==1 ? 1 : n * factorial(n-1) );
fact=factorial(10);
echo(fact=fact);
Language - Looping
● Often used to create multiple instances of objects
parameterized by the loop variable
● Format
○ for (var = [start:end]) { actions }
○ for (var = [start:step:end]) { actions }
Language - Conditional
● if (logical expression) { actions } else { actions }
Language - Math Functions
● abs, sign, sin, cos, tan, acos, asin, atan, atan2, floor, round,
ceil, ln, len, let, log, pow, sqrt, exp, rands, min, max
Language - Libraries
● include <filename>
○ inserts contents of file at that point in the including file
○ included file is OpenSCAD formatted
○ modules and functions are defined
○ commands are executed
● use <filename>
○ modules and functions are defined
○ included file is OpenSCAD formatted
○ NO commands are executed
● import <STL/OFF/DXF file>
○ imports and renders file

More Related Content

What's hot

Partes de un robot
Partes de un  robotPartes de un  robot
Partes de un robotMafer
 
Introduction to Robotics
Introduction to Robotics Introduction to Robotics
Introduction to Robotics YAZEN SHAKIR
 
Robotics
RoboticsRobotics
Roboticskewins
 
Introduction to Go language
Introduction to Go languageIntroduction to Go language
Introduction to Go languageTzar Umang
 
my ppt for autocad &autocad electrical
my ppt for autocad &autocad electricalmy ppt for autocad &autocad electrical
my ppt for autocad &autocad electricalh soundarya
 
Space robotics(my seminor) final
Space robotics(my seminor) finalSpace robotics(my seminor) final
Space robotics(my seminor) finalAnkur Pathak
 
Exact Cell Decomposition of Arrangements used for Path Planning in Robotics
Exact Cell Decomposition of Arrangements used for Path Planning in RoboticsExact Cell Decomposition of Arrangements used for Path Planning in Robotics
Exact Cell Decomposition of Arrangements used for Path Planning in RoboticsUmair Amjad
 
【Unite Tokyo 2018】カスタムシェーダーでモバイルでも最先端グラフィックスな格闘ゲームを!
【Unite Tokyo 2018】カスタムシェーダーでモバイルでも最先端グラフィックスな格闘ゲームを!【Unite Tokyo 2018】カスタムシェーダーでモバイルでも最先端グラフィックスな格闘ゲームを!
【Unite Tokyo 2018】カスタムシェーダーでモバイルでも最先端グラフィックスな格闘ゲームを!UnityTechnologiesJapan002
 
Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)bluejayjunior
 
Recent progress on programming methods for industrial robots
Recent progress on programming methods for industrial robotsRecent progress on programming methods for industrial robots
Recent progress on programming methods for industrial robotsDeepak Rotti
 
Second Year ENTC Engg (Minor Project) on Motion Imitating Robotic Arm.
Second Year ENTC  Engg (Minor Project) on Motion Imitating Robotic Arm.Second Year ENTC  Engg (Minor Project) on Motion Imitating Robotic Arm.
Second Year ENTC Engg (Minor Project) on Motion Imitating Robotic Arm.Omkar Rane
 
Product design solidworks training ppt
Product design  solidworks training pptProduct design  solidworks training ppt
Product design solidworks training pptRiteshYadav134
 
Programing paradigm &amp; implementation
Programing paradigm &amp; implementationPrograming paradigm &amp; implementation
Programing paradigm &amp; implementationBilal Maqbool ツ
 

What's hot (20)

Robot Manipulation Basics
Robot Manipulation BasicsRobot Manipulation Basics
Robot Manipulation Basics
 
ABB training report
ABB training reportABB training report
ABB training report
 
Partes de un robot
Partes de un  robotPartes de un  robot
Partes de un robot
 
INTRODUCTION TO ROBOTICS
INTRODUCTION TO ROBOTICSINTRODUCTION TO ROBOTICS
INTRODUCTION TO ROBOTICS
 
Robotics.pptx
Robotics.pptxRobotics.pptx
Robotics.pptx
 
Introduction to Robotics
Introduction to Robotics Introduction to Robotics
Introduction to Robotics
 
Robotics
RoboticsRobotics
Robotics
 
Introduction to Go language
Introduction to Go languageIntroduction to Go language
Introduction to Go language
 
my ppt for autocad &autocad electrical
my ppt for autocad &autocad electricalmy ppt for autocad &autocad electrical
my ppt for autocad &autocad electrical
 
Space robotics(my seminor) final
Space robotics(my seminor) finalSpace robotics(my seminor) final
Space robotics(my seminor) final
 
Exact Cell Decomposition of Arrangements used for Path Planning in Robotics
Exact Cell Decomposition of Arrangements used for Path Planning in RoboticsExact Cell Decomposition of Arrangements used for Path Planning in Robotics
Exact Cell Decomposition of Arrangements used for Path Planning in Robotics
 
Google sketch up tutorial
Google sketch up tutorialGoogle sketch up tutorial
Google sketch up tutorial
 
【Unite Tokyo 2018】カスタムシェーダーでモバイルでも最先端グラフィックスな格闘ゲームを!
【Unite Tokyo 2018】カスタムシェーダーでモバイルでも最先端グラフィックスな格闘ゲームを!【Unite Tokyo 2018】カスタムシェーダーでモバイルでも最先端グラフィックスな格闘ゲームを!
【Unite Tokyo 2018】カスタムシェーダーでモバイルでも最先端グラフィックスな格闘ゲームを!
 
Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)
 
Recent progress on programming methods for industrial robots
Recent progress on programming methods for industrial robotsRecent progress on programming methods for industrial robots
Recent progress on programming methods for industrial robots
 
Second Year ENTC Engg (Minor Project) on Motion Imitating Robotic Arm.
Second Year ENTC  Engg (Minor Project) on Motion Imitating Robotic Arm.Second Year ENTC  Engg (Minor Project) on Motion Imitating Robotic Arm.
Second Year ENTC Engg (Minor Project) on Motion Imitating Robotic Arm.
 
Robot studio abb
Robot studio abbRobot studio abb
Robot studio abb
 
Product design solidworks training ppt
Product design  solidworks training pptProduct design  solidworks training ppt
Product design solidworks training ppt
 
Programing paradigm &amp; implementation
Programing paradigm &amp; implementationPrograming paradigm &amp; implementation
Programing paradigm &amp; implementation
 
Robotics Navigation
Robotics NavigationRobotics Navigation
Robotics Navigation
 

Similar to OpenSCAD Tutorial

Blockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub GrazBlockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub GrazBlockchainHub Graz
 
Python for PHP developers
Python for PHP developersPython for PHP developers
Python for PHP developersbennuttall
 
Dart the better Javascript 2015
Dart the better Javascript 2015Dart the better Javascript 2015
Dart the better Javascript 2015Jorg Janke
 
Substrait Overview.pdf
Substrait Overview.pdfSubstrait Overview.pdf
Substrait Overview.pdfRinat Abdullin
 
Baby steps to Domain-Driven Design
Baby steps to Domain-Driven DesignBaby steps to Domain-Driven Design
Baby steps to Domain-Driven DesignŽilvinas Kuusas
 
Blueprints: Introduction to Python programming
Blueprints: Introduction to Python programmingBlueprints: Introduction to Python programming
Blueprints: Introduction to Python programmingBhalaji Nagarajan
 
High Performance Rust UI.pdf
High Performance Rust UI.pdfHigh Performance Rust UI.pdf
High Performance Rust UI.pdfmraaaaa
 
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io
 
Build your Own Customizable 3D Objects with Sculpteo
Build your Own Customizable 3D Objects with SculpteoBuild your Own Customizable 3D Objects with Sculpteo
Build your Own Customizable 3D Objects with SculpteoSculpteo
 
Blender presentation at SIGGRAPH 2013
Blender presentation at SIGGRAPH 2013Blender presentation at SIGGRAPH 2013
Blender presentation at SIGGRAPH 2013prokoudine
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).pptHIMANKMISHRA2
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.pptHIMANKMISHRA2
 
Domain Driven Design: Zero to Hero
Domain Driven Design: Zero to HeroDomain Driven Design: Zero to Hero
Domain Driven Design: Zero to HeroFabrício Rissetto
 
Interprocess communication with C++.pdf
Interprocess communication with C++.pdfInterprocess communication with C++.pdf
Interprocess communication with C++.pdfDimitrios Platis
 
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ... Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...Andy Maleh
 
Civil project .ppt
Civil project .pptCivil project .ppt
Civil project .pptPremArumalla
 

Similar to OpenSCAD Tutorial (20)

Blockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub GrazBlockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub Graz
 
Feel++ webinar 9 27 2012
Feel++ webinar 9 27 2012Feel++ webinar 9 27 2012
Feel++ webinar 9 27 2012
 
AutoCAD Architecture
AutoCAD ArchitectureAutoCAD Architecture
AutoCAD Architecture
 
Python for PHP developers
Python for PHP developersPython for PHP developers
Python for PHP developers
 
Dart the better Javascript 2015
Dart the better Javascript 2015Dart the better Javascript 2015
Dart the better Javascript 2015
 
Ruby meets Go
Ruby meets GoRuby meets Go
Ruby meets Go
 
Substrait Overview.pdf
Substrait Overview.pdfSubstrait Overview.pdf
Substrait Overview.pdf
 
Baby steps to Domain-Driven Design
Baby steps to Domain-Driven DesignBaby steps to Domain-Driven Design
Baby steps to Domain-Driven Design
 
Blueprints: Introduction to Python programming
Blueprints: Introduction to Python programmingBlueprints: Introduction to Python programming
Blueprints: Introduction to Python programming
 
Go_ Get iT! .pdf
Go_ Get iT! .pdfGo_ Get iT! .pdf
Go_ Get iT! .pdf
 
High Performance Rust UI.pdf
High Performance Rust UI.pdfHigh Performance Rust UI.pdf
High Performance Rust UI.pdf
 
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and Golang
 
Build your Own Customizable 3D Objects with Sculpteo
Build your Own Customizable 3D Objects with SculpteoBuild your Own Customizable 3D Objects with Sculpteo
Build your Own Customizable 3D Objects with Sculpteo
 
Blender presentation at SIGGRAPH 2013
Blender presentation at SIGGRAPH 2013Blender presentation at SIGGRAPH 2013
Blender presentation at SIGGRAPH 2013
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).ppt
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.ppt
 
Domain Driven Design: Zero to Hero
Domain Driven Design: Zero to HeroDomain Driven Design: Zero to Hero
Domain Driven Design: Zero to Hero
 
Interprocess communication with C++.pdf
Interprocess communication with C++.pdfInterprocess communication with C++.pdf
Interprocess communication with C++.pdf
 
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ... Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 
Civil project .ppt
Civil project .pptCivil project .ppt
Civil project .ppt
 

More from John Oliva

Sensor enclosure presentation
Sensor enclosure presentationSensor enclosure presentation
Sensor enclosure presentationJohn Oliva
 
Printing with PETG
Printing with PETGPrinting with PETG
Printing with PETGJohn Oliva
 
NYC Titanium User's Group - 2/18 Organizer Topics
NYC Titanium User's Group - 2/18 Organizer TopicsNYC Titanium User's Group - 2/18 Organizer Topics
NYC Titanium User's Group - 2/18 Organizer TopicsJohn Oliva
 
NYC Titanium User's Group - 12/13 Organizer Topics + Presentation Video
NYC Titanium User's Group - 12/13 Organizer Topics + Presentation VideoNYC Titanium User's Group - 12/13 Organizer Topics + Presentation Video
NYC Titanium User's Group - 12/13 Organizer Topics + Presentation VideoJohn Oliva
 
NYC Titanium User's Group - Accelerated Development with TiShadow
NYC Titanium User's Group - Accelerated Development with TiShadowNYC Titanium User's Group - Accelerated Development with TiShadow
NYC Titanium User's Group - Accelerated Development with TiShadowJohn Oliva
 
NYC Titanium User's Group - tiConf US Revisited
NYC Titanium User's Group - tiConf US RevisitedNYC Titanium User's Group - tiConf US Revisited
NYC Titanium User's Group - tiConf US RevisitedJohn Oliva
 
NYC Titanium User's Group - Tools and Techniques for Mobile UI/UX
NYC Titanium User's Group - Tools and Techniques for Mobile UI/UXNYC Titanium User's Group - Tools and Techniques for Mobile UI/UX
NYC Titanium User's Group - Tools and Techniques for Mobile UI/UXJohn Oliva
 
NYC Titanium User's Group - Mobile Analytics
NYC Titanium User's Group - Mobile AnalyticsNYC Titanium User's Group - Mobile Analytics
NYC Titanium User's Group - Mobile AnalyticsJohn Oliva
 
CTO School - Titanium Overview
CTO School - Titanium OverviewCTO School - Titanium Overview
CTO School - Titanium OverviewJohn Oliva
 
NYC Titanium User's Group - Kickoff Meeting
NYC Titanium User's Group - Kickoff MeetingNYC Titanium User's Group - Kickoff Meeting
NYC Titanium User's Group - Kickoff MeetingJohn Oliva
 

More from John Oliva (10)

Sensor enclosure presentation
Sensor enclosure presentationSensor enclosure presentation
Sensor enclosure presentation
 
Printing with PETG
Printing with PETGPrinting with PETG
Printing with PETG
 
NYC Titanium User's Group - 2/18 Organizer Topics
NYC Titanium User's Group - 2/18 Organizer TopicsNYC Titanium User's Group - 2/18 Organizer Topics
NYC Titanium User's Group - 2/18 Organizer Topics
 
NYC Titanium User's Group - 12/13 Organizer Topics + Presentation Video
NYC Titanium User's Group - 12/13 Organizer Topics + Presentation VideoNYC Titanium User's Group - 12/13 Organizer Topics + Presentation Video
NYC Titanium User's Group - 12/13 Organizer Topics + Presentation Video
 
NYC Titanium User's Group - Accelerated Development with TiShadow
NYC Titanium User's Group - Accelerated Development with TiShadowNYC Titanium User's Group - Accelerated Development with TiShadow
NYC Titanium User's Group - Accelerated Development with TiShadow
 
NYC Titanium User's Group - tiConf US Revisited
NYC Titanium User's Group - tiConf US RevisitedNYC Titanium User's Group - tiConf US Revisited
NYC Titanium User's Group - tiConf US Revisited
 
NYC Titanium User's Group - Tools and Techniques for Mobile UI/UX
NYC Titanium User's Group - Tools and Techniques for Mobile UI/UXNYC Titanium User's Group - Tools and Techniques for Mobile UI/UX
NYC Titanium User's Group - Tools and Techniques for Mobile UI/UX
 
NYC Titanium User's Group - Mobile Analytics
NYC Titanium User's Group - Mobile AnalyticsNYC Titanium User's Group - Mobile Analytics
NYC Titanium User's Group - Mobile Analytics
 
CTO School - Titanium Overview
CTO School - Titanium OverviewCTO School - Titanium Overview
CTO School - Titanium Overview
 
NYC Titanium User's Group - Kickoff Meeting
NYC Titanium User's Group - Kickoff MeetingNYC Titanium User's Group - Kickoff Meeting
NYC Titanium User's Group - Kickoff Meeting
 

Recently uploaded

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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 Scriptwesley chun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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 2024The Digital Insurer
 
[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.pdfhans926745
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
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 2024The Digital Insurer
 
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 slidevu2urc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
[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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

OpenSCAD Tutorial

  • 2. Intro What is OpenSCAD? ● 3D modeling program based on constructive solid geometry ● Dynamically typed language ● Open Source: https://github.com/openscad/openscad ● Windows, Mac OS X, Linux (14 - 23 MB), web app (openscad.net) ● GUI or CLI usage
  • 3. Intro Why OpenSCAD? ● Free to obtain and for commercial use ● Parametric - easy to adjust object to customize use ● Simple language ● Large amount of existing code freely available (Github, Thingiverse, etc.) ● Large user community ● Well established - been around since 2010 ● Produces solid, watertight 3D objects ● Good online documentation
  • 4. Intro Differentiators from other 3D CAD? ● Declarative, procedure oriented programming ● Interactive design - but not by interacting directly with rendered model on screen ● Customizers ○ Thingiverse ○ Built into development version of OpenSCAD ● Computational generation of shapes (e.g. fractal shaped object)
  • 5. Resources ● www.openscad.org ● cheatsheet: www.openscad.org/cheatsheet ● manual: en.wikibooks.org/wiki/OpenSCAD_User_Manual ● Libraries ○ OpenSCAD general library of relativity ■ github.com/davidson16807/relativity.scad/wiki ■ www.thingiverse.com/thing:349943 ○ MCAD library ■ github.com/openscad/MCAD ■ Lots of resources for mechanical design ● Alternative language interfaces ○ SolidPython: github.com/SolidCode/SolidPython ○ OpenJSCAD: openjscad.org ● Web based OpenSCAD: openscad.net
  • 6. Installation ● www.openscad.org/downloads.html ● Latest stable releases ○ Mac OS X: 2015.03-3 ○ Windows: 2015.03-2 ○ Linux: 2015.03-2 ● Much more recent development snapshots
  • 7. Quick GUI Overview ● Preview/Render pane ● Code pane ○ detachable ○ supports external editor (Design->Automatic Reload and Preview) ● Console pane ○ detachable ● Customizer pane ○ detachable ○ not currently available in stables releases
  • 8. Workflow ● Iterate (until happy with design) ○ Write OpenSCAD code ○ Preview using F5 (generates CSG representation for OpenGL rendering) ● Render to full geometry using F6 (generates CGAL representation, surfaces, edges, vertices) ● Export to a format for import into subsequent tool ○ e.g. STL for import into siicer ○ export formats: STL, OFF, AMF, DXF, SVG, CSG, PNG
  • 9. Concepts - 2D Shapes ● Circle ● Square (actually rectangle) ● Polygon ● Text
  • 10. Concepts - 3D Shapes ● Cube (actually rectangular prism) ● Sphere ● Cylinder (or cone)
  • 11. Concepts - Transforms ● Translate ● Scale ● Rotate ● Mirror ● Color ● Others: resize, multmatrix, offset, hull, minkowski
  • 12. Concepts - Boolean Operations ● Union ○ combines multiple shapes into a single object ● Difference ○ removes/subtracts second and remaining shapes from the first shape ● Intersection ○ leaves the parts that are common to all of the shapes included
  • 13. Concepts - Extrusions ● Linear ○ extends a 2D object in the X/Y plane in the Z direction ● Rotational ○ rotates a 2D object defined in the X/Y plane around the Z axis
  • 14. Concepts - Surface ● Creates a 3D object from: ○ height map data file ○ PNG image where grayscale indicates height ○ Can be used to create a lithophane
  • 16. Language - Comments ● line: // ● block: /* */
  • 17. Language - Console logging ● echo (aa,bb,cc,dd); ● echo (var=var);
  • 18. Language - Types ● No declaration required ● Numbers (integer, floating point) ● Boolean (true/false) ● String ● Vector ● Undefined (undef)
  • 19. Language - Variables ● variable_name = expression ● Variable values at calculated at compile-time, not run-time ● Special variables - start with $ ○ $fa minimum angle ○ $fs minimum size ○ $fn minimum # of fragments ○ $t animation step ○ Others: $vpr, $vpt, $vpd
  • 20. Language - Operators ● arithmetic: *, /, +, -, % ● relational: <, >, <=, >=, ==, != ● logical: &&, ||, ! ● conditional: exp ? val1 : val2 ● vector: +, -
  • 21. Language - List Comprehensions ● Used to generate a list ● Examples ○ Squares: squares = [ for(i=[0:10]) i*i ]; echo (squares); ○ Divisible by 3: div3 = [ for(i=[0:20]) if (i%3 == 0) i ]; echo (div3);
  • 22. Language - Modules ● Operates like a subroutine in other languages and does not return a value ● Most often used for constructing higher order 2D or 3D objects from simpler ones ● Format: module name (comma_sep_param_list) { … }
  • 23. Language - Functions ● Operates like a function in other languages although defined as a single expression returning a value ● Most often used for constructing higher order 2D or 3D objects from simpler ones ● Format: function name (params) = expression yielding a value ● Example - Factorial function factorial(n) = ( n==1 ? 1 : n * factorial(n-1) ); fact=factorial(10); echo(fact=fact);
  • 24. Language - Looping ● Often used to create multiple instances of objects parameterized by the loop variable ● Format ○ for (var = [start:end]) { actions } ○ for (var = [start:step:end]) { actions }
  • 25. Language - Conditional ● if (logical expression) { actions } else { actions }
  • 26. Language - Math Functions ● abs, sign, sin, cos, tan, acos, asin, atan, atan2, floor, round, ceil, ln, len, let, log, pow, sqrt, exp, rands, min, max
  • 27. Language - Libraries ● include <filename> ○ inserts contents of file at that point in the including file ○ included file is OpenSCAD formatted ○ modules and functions are defined ○ commands are executed ● use <filename> ○ modules and functions are defined ○ included file is OpenSCAD formatted ○ NO commands are executed ● import <STL/OFF/DXF file> ○ imports and renders file