Module 2 - Computer-Aided Design (CAD)#
This week’s assignment is to :
- Design, model, and document a parametric FlexLinks construction kit that we will fabricate next week using 3D printers.
- Make it parametric, to be able to make adjustments accounting for the material properties and the machine characteristics.
- Read about Creative Commons open-source licenses and add a CC license to my work.
- Complete the FlexLinks kit by fetching the code of at least 1 part made by another classmate during this week. Get the parts ready to print.
2.1 Introduction#
In order to be able to perform the necessary tasks, 3 open source software tools were introduced: OpenSCAD, Inkscape and FreeCAD.
Feature/Aspect | Inkscape | FreeCAD | OpenSCAD |
---|---|---|---|
Primary Focus | 2D vector graphics | 3D parametric modeling | Code-based 3D design |
Ease of Use | Intuitive GUI | Moderate (GUI) | Requires coding skills |
Best For | Artistic design | Engineering & architecture | Mathematical designs |
Output | 2D images (SVG, PNG) | 3D models (STEP, STL) | 3D models (STL, DXF) |
Flexibility | High for 2D graphics | High for 3D design | High for parametric shapes |
Skillset Needed | Artistic/Design skills | CAD and engineering | Coding skills |
To meet the necessary requirements and to introduce myself to the CAD world, I chose to use OpenSCAD, due to the fact that it requires code creation, and I am much more familiar with it. At the same time, I consider it the right choice because thanks to the code, it is much easier to parameterize the desired objects.
2.1.1 OpenSCAD#
First step is to install OpenSCAD to our machine, we can do that following this link OpenSCAD, here you can find the install for all the platforms. I chose to install it from terminal using Homebrew (i want to remind you that i am working on MacOs) with command brew install --cask openscad
, on a Ubuntu Os(Linux) you can use sudo apt install openscad
.
Now that OpenSCAD is installed , it may be useful to have access to the OpenSCAD_doc. The documentation of a software is always very important, you can discover tools and also find the needed command for your code. I advice you to check the OpenSCAD tutorial by Nicolas De Coster. This was my starting point in discovering OpenSCAD and helped me a lot. There is also a cheat sheet available that contains the most basic and useful functions. You can check this video to learn more about what is a Compliant Mechanism.
2.2 Designing a flexilink#
The objective is to design a flexilink ,I chose to create this flexlink called “Satellite” Beam.
You can find more flexilink examples here .
2.2.1 Basic part#
The first part that forms the basis of the flexilink is the one that has holes so it can be combined with Lego, see a picture below.
To achieve this, I created 2 modules (functions). Like you can understand, in the second module i create a rounded rectangle, where two cylinders were initially positioned and a convex hull was created between them . Now , to create our part, we use the difference() between the rounded rectangle and multiple cylinders. The number of cylinders is determined by the number of holes that we want to have. Also, the radius of the cylinders that we take out is smaller from the radius of initially positioned cylinders, this is mandatory.
module holesPiece(height, n_holes, r_int, r_ext) {
lenght=r_ext*2*(n_holes-1);
difference() {
rounded_rectangle(height,lenght,r_ext);
for (i = [0 : n_holes-1]) {
translate([0, r_ext *2 *i, 0])
cylinder(h = height, r = r_int);
}
}
}
module rounded_rectangle(height,lenght,r){
hull() {
cylinder(h=height, r=r);
translate([0, lenght, 0])
cylinder(h=height, r=r );
}
}
2.2.2 Next step#
The next step is to make a component with a empty center, that later will be combined with our previous part.
It’s simple to do, just using the module rounded_rectangle from previous part, we create 2 rounded rectangles where the cylinders have different radius and we make the difference between them.
module emptyPart(height, length, r_int, r_ext) {
difference() {
rounded_rectangle(height,length,r_ext);
rounded_rectangle(height,length,r_int);
}
}
2.2.3 Combined structure#
Now is time to combine the part from previous steps.
The function union() of OpenSCAD is used to combine multiple parts, but also translate() it used to give the start coordinates of every part, this is very important, because only introducing the right coordinates, the desired combined part will be obtained . Rotate() is used for the basic part with holes created in the beginning, and makes the needed rotation.
module struct(height, holes, length, r_int, r_ext) {
union() {
translate([0,-length/2,0]) {
emptyPart(height, length, r_int, r_ext);
}
translate([0,length/2, 0]) {
rotate([0, 0, -40])
holesPiece(height, holes, r_int, r_ext);
}
translate([0, -length/2, 0]) {
rotate([0, 0, -140])
holesPiece(height, holes, r_int, r_ext);
}
}
}
2.2.4 Strip#
the strip represents the skeleton of the figure, and is created using Cube() function.
cube([length, width, height]);
2.2.5 Satelite#
After creating all the parts, final step is to combine all of the into a single one that will represent the Satelite.
For this I also used the Union() and translate() function, It took some time to play with the translation, so the figure should be correctly combined , but in the end, the Satelite is ready.
module satellite(height, strip_length, strip_width, n_holes_base, base_struct_length, r_int, r_ext, n_holes) {
union() {
base(height, n_holes_base, base_struct_length, r_int, r_ext);
translate([r_ext,-strip_width/2,0]) {
strip(height, strip_lenght, strip_width);
}
translate([strip_length+r_ext*2-(r_ext-r_int)/2,0,0]) {
rotate([0, 0, -90]) {
holesPiece(height, n_holes, r_int, r_ext);
}
}
}
}
The entire code is created from modules, this is why it is a code that allows us to very easily modify the desired parameters for flexilinks.
2.2.6 Licensing the work#
In open source, in order to allow others to use our documentation or our code, licensing our work is very important. Here you have a link with more information about CC Licences. The licence i chose is CC BY-SA 4.0 . This license allows others to use the code, and improve it, for both commercial and non-commercial purposes, as long as they give credit to the author. Notice that adaptions must be shared under the same terms. Here you can find the example that I used at the beginning of my code.
//File : flexlink.scad
// Author : Melnic Alexandru
// License : Creative Commons Attribution-ShareAlike 4.0 International [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)
2.3 Fetching another code#
For my flexilink kit to be complete, I need Lego blocks. In this case i can use the code of Noa Lipmanowicz
$fn=50;
lon = 60; // longueur du cube
la = 10; //largeur du cube
ha = 9; // hauteur du cube
ha_cyl = 2.5; // hauteur des cylindres
rc = 2.5; //rayon des cylindres
ha_trou = 11; // hauteur des cylindres formant les trous
union() {
translate([5,5])
for( i = [0:6]) {
translate([i*8,0,9])
cylinder(h=ha_cyl,r=rc);
}
difference(){
cube([lon,la,ha]);
translate([23,0,0])
for (i=[0:5]){
translate([i*10,10.5,4.5])
rotate([90,0,0])cylinder(h=ha_trou, r=rc);
}
}
translate([3.5,0,0])
for (i=[0:1]){
translate([i*10.5,0,4.5])
rotate([90,0,0])cylinder(h=ha_cyl,r=rc);
}
}
The code is very clean and it’s exactly what i need. So i modified just the parameters so i can combine the lego with my Satelite.
2.3.1 Licensing#
Since I have reused the code of someone else, it is important to cite the original work. In order to do this,a field Credits will be added to the license part. This text must be added at the top of the code/file. Also i need to share my adaption of the work under the same license as the original one.
//File : flexlink.scad
// Author : Melnic Alexandru
// License : Creative Commons Attribution-ShareAlike 4.0 International [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)
// Credits : The original work is attributed to Antoine Trillet, shared under the CC BY-SA license. The original version of this file can be found [here](https://noa-lipmanowicz-fablab-ulb-enseignements-2023-20-cba683afe410fd.gitlab.io/fabzero-modules/module02/) .