SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
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

Contenu connexe

Similaire à 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
 

Similaire à 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
 

Plus de 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
 

Plus de 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
 

Dernier

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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 MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
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
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Dernier (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

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