Parametric Design Tutorial
A lil' introduction
This week, we have to study and test parametric design for our pressfit contruction kit. But first of all, what are we talking about ?
What is parametric design ?
This is the Wikipedia definition :
“Parametric design is a process based on algorithmic thinking that enables the expression of parameters and rules that, together, define, encode and clarify the relationship between design intent and response.”
To summarize it, it is a design driven by parameters. It is governed by a certain logic, logic that includes algorithms. Those algorithms include certain parameters which can be varied to see multiple outcomes. It is mostly used to play with the geometry of certain structures.
An image is worth a thousand word they say, so here is a well known example that used this principle, the Holocaust memorial in Berlin :
Starting with intentionally chosen value for the graves, and by imposing certain rules on the system, the architect was able to obtain a very complex result, that can be recalculated by simply tweaking the original parameters.
What are the advantages of using parametric design ?
Every time you change the value of a parameter, its changes everything related to it according to the new value.
It saves you a lot of time, and is more likely to be accurate. It creates efficiency, and a work that you can easily use as many times as you need in other design projects.
Parametric Design in OpenScad
To do my week’s assignment, I decided to use OpenScad. I found this tutorial that helped me a lot : https://www.cc.gatech.edu/classes/AY2016/cs1301_fall/codesamples/UsingOpenSCAD.pdf
First thing to do, test the code I found on the tutorial and then apply it to my assignment. I’ll use the parametric design to do the notches of my pressfit construction kit.
In order to to this, we have to use an iteration in a loop. We’ll use variables to change the parameters of our shape. Feeling lost ? Don’t worry, I’ll take you step by step to understand everything :)
Step 1 : create variables
A variable is like a box, where you’ll put a value in it. You declare it at the beginning of your file, and you can use it as many times as you want it in your program.
Now, I just have to change the value of our variable to change all the squares.
Do you remember my safe on week 3 ? You can go and see a more complex parametric code I used for the digits of the safe, based on the same translating principle.
For the notches of my pressfit kit, I’ll create variables for the width and height. Thanks to it, I’ll just have to change the variables according to what I need for my future projects.
Step 2 : create a module to multiply the shape
Here comes the tricky part. I’ll use the module explained in the tutorial that I showed you before. Like I did with the parametric code for my safe, I’ll take you step by step through it.
Here is the whole code :
Just so you know, my values are in millimiters (mm).
What does it mean ?
Which means : the module named notchesSphere will multiply accordingly to the parameter I’ll put in between brackets.
Here we use an iteration via a for loop, like we did last week with the digits of the safe. It means :
- for an iteration, from 0 to variable HowMany
- rotate on a 360 angle the element according to the HowMany value...
- and translate...
- this square that will be sized according to the h and w values.
Here is the result !
Step 3 : create notches in a sphere
My first pressfit construction kit module will be a sphere.
It’s important that my first module stays outside of my sphere one, so I can call it in any other modules I want to create.
Now that I can multiply them, I just have to use the “difference” function in OpenScad to create holes in my sphere. Here’s the full code and result for the sphere, with the notches
Step 4 : go crazy and create all sorts of shapes :)
Now that I have my code all set and prepared, I just have to come up with other designs and add it to those new shapes :)
Wanna try by yourslef ?
Here is the link to my file, feel free to download it and create your own shapes :
Name of the document | Link to download |
---|---|
Pressfit Construction Kit - Parametric Design Exemples | Shapes to have fun and make crazy constructions ^^ |