2. Computer-Aided Design (CAD)#
Week’s introduction#
We started this week with an introduction to compliant mechanism/flexure concept, a step into the 3D world with an OpenSCAD and FreeSCAD tutorial and the importance of licenses.
Compliant mechanism and Flexures#
Compliant mechanism#
Compliant mechanism is the concept of making a flexible and deformable structure while achieving mechanical functionality without the traditional
way of using joints or rigid parts to interconnect parts. It mainly relies on the inherent flexibility and deformation of their material to perform a specific mechanical task.
These pieces are designed using principles of elasticity and material science to produce desired motions or forces by
exploiting the flexibility of the structure itself. This mechanism reduces the parts of the structure, reducing the cost
of manufacturing with it, which makes their maintenance much more easy and effective.
Here is an original plier, so much different than the one we all know; Two hinged arms and serrated jaws. This tool is
made from one single and continues piece of plastic.
Flexure#
Flexure describes the ability of a material to bend or flex under stress to a certain point without breaking. Understanding flexure is crucial in the design of compliant mechanisms and other flexible structures in engineering applications.
3D Tools#
3D tools are crucial in the conception phase and also essential in various fields such as product design, architecture, animation, and engineering. These tools allow designers and engineers to create three-dimensional digital representations of objects, structures, or characters. There are some great open-source apps for 3D modeling like: Blender, FreeCAD and OpenSCAD.
OpenSCAD#
Get Started#
OpenSCAD is a free open-source software for creating solid 3D CAD objects.
For a start, if you don’t have it already, download it here.
To create a new project, open OpenScad and click on New.
This is the main window that will pop after creating a new project. The white part is the script/text editor part, the yellow
one is for the visualization of your 3D creation.
The 3 icons below are the most important for visualization; Preview is a presentations used for quick feedback and adjustments during the design process on the right side of the window,
Render is for the high-quality, time-consuming outputs used for final presentations and productions, Export as STL
is a format that represents the piece’s surface geometry as a collection of triangles which is suitable for 3D printers or any other physical representation of the model.
Script and Basics#
Cubes#
Parameters : a = one size / [width,depth,height] / [width,depth,height], center= true
cube(10);
cube([10,15,20]);
Spheres#
Parameters : r = radius / d = diameter
sphere(5);
sphere(15);
N.B: The system variable $fn determines how many line segments are used. So it can be used to:
Create smoother arcs and spherical surfaces Create various regular polygons and solids.
sphere(15,$fn=1200);
sphere(15,$fn=8);
Transformations#
Translation#
Parameters : [width,depth,height]
translate([5,5,-5]) cube(15);
Rotation#
Parameters : [width,depth,height]
rotate([30,20,10]) cube(15);
Resizing#
Parameters : [width,depth,height]
resize([20,20,10]) cube(15);
Scaling#
Parameters : [width,depth,height]
scale([5,5,1]) cube(15);
Coloring#
Parameters : [red,green,blue]
color[255,0,0] cube(15);
Boolean Operations#
Union#
union(){
sphere(10);
cube(15,true);
}
Difference#
difference(){
sphere(10);
cube(15,true);
}
Intersection#
intersection(){
sphere(10);
cube(15,true);
}
Hull#
hull(){
cube([60,3,49]);
cylinder(h=10, r= 3);
}
FreeCAD#
Get Started#
FreeCAD is an open-source parametric 3D CAD (Computer-Aided Design) modeler. It is used for designing real-life objects of any size. Parametric modeling allows you to easily modify your design
by going back into your model history and changing its parameters.
You can download FreeCAD by clicking here.
To start, Open FreeCAD
Select “Switch between workbenches” on the top bar (defaults with -> Start) and choose “Part design” to create a new body
On the left side of the window, select “Create body” on the Combo View, Then “Create Sketch.”
Now you have to choose a plane as the base of your piece and create a 2D shape as a starting point.
The video below shows all the steps of creating the base of your piece. First we create the 2D shape wanted, we set the constraints, then we center the two
axises inside our shape until all the white lines become green.
Having the base set, click close on the sidebar, then you can do the rest of the 3D work as you want.
The Process Of Modeling Using 3D Software#
Using OpenSCAD, I decided to create a portable door lock that locks the door without using a key and blocks others from opening the
door from the outside using a key or knob. This piece is a great gadget for your security, specially when you are abroad (on a trip, Hostel, Etc.).
To begin with, I created a cube that goes inside the frame of the door (where the lock naturally goes in), this will help the
portable lock to stay in and have a support against the outside forces. Then I made another perpendicular cube outside the
door, which will be linked to a screw later.
translate([0,-20,0]) cube([3,20,49]);
translate([0,-1.5,0])cube([60,3,49]);
And since the screw will be at the end of the cube, I changed its form using hull() to make the link look smoother and not straight cut into the screw. Tying the cube we had with a new cylinder, we get the perfect form to hold the screw.
hull(){
translate([0,-1.5,0])cube([60,3,49]);
translate([55,0,49/2]) rotate([0,90,0]) color("blue") cylinder(h=10, r= 3); }
Using this code from Robert Rapplea that I found on [OpenSCAD] Creating screw threads? discussion, I created the screw.
module screw(r){
linear_extrude(h=10, twist=90*120){
union(){
circle(r);
polygon([[r,0],[.75813,3],[.75813,5]]);
polygon([[-r,0],[.75813,3],[-.75813,-5]]);
}
}
}
translate([65,0,49/2]) rotate([0,90,0]) screw(3);
Now that the main part is made,we need to create the piece that blocks the door, which goes inside the screw. To make the fastner, I made a cylinder and removed its inside using the form of the screw, then added two parallel blocks on each side of the cylinder that pushes the door not letting it open.
module fastner(){
difference(){
translate([65,0,height/2]) rotate([0,90,0]) color("red") cylinder(h=50, r= 7);
translate([60,0,height/2]) rotate([0,90,0]) screw(4);
}
}
module doorblock(){
fastner();
hull(){
translate([70,-21.5,height/2]) cube([40,15,3]);
translate([30,-40,height/2]) cube([30,20,3]);
}
}
module fulldoorblock(){
doorblock();
mirror([0,1,0]) doorblock();
}
Assembling everything we have made, we get the full Portable door lock!!
//Author: Ali Bahja
//Attribution-NonCommercial-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-nc-sa/4.0/)
height = 30;
module screw(r){
linear_extrude(70,twist =10100)
{
union()
{
circle(r);
polygon([[r,0],[1.75813,3],[1.75813,5]]);
polygon([[-r,0],[1.75813,3],[-1.75813,-5]]);
}}}
module mainpart(){
translate([0,-20,0]) cube([3,20,height]);
hull(){
color("green") translate([0,-1.5,0])cube([60,3,height]);
translate([55,0,height/2]) rotate([0,90,0]) color("blue") cylinder(h=10, r= 3);}
translate([63,0,height/2]) rotate([0,90,0]) screw(4);}
module fastner(){
difference(){
translate([65,0,height/2]) rotate([0,90,0]) color("red") cylinder(h=50, r= 7);
translate([60,0,height/2]) rotate([0,90,0]) screw(4);
}
}
module doorblock(){
fastner();
hull(){
translate([70,-21.5,height/2]) cube([40,15,3]);
translate([30,-40,height/2]) cube([30,20,3]);
}
}
module fulldoorblock(){
doorblock();
mirror([0,1,0]) doorblock();
}
//for the whole piece together
mainpart();
fulldoorblock();
Licenses#
Open-source licenses are essential as they provide legal clarity, developing community collaboration and innovation. They also prevent misuse by specifying how the software can be shared, modified, and distributed. They ensure proper attribution, recognition for contributors, and avoid legal disputes, promoting a vibrant and sustainable open-source ecosystem. The best way to decide between the six licenses below is to think about why you want to share your work, and how you hope others will use that work.
License | Permission to use & remix |
---|---|
![]() |
![]() |
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
![]() ![]() ![]() |
![]() |
![]() ![]() |
![]() |
![]() ![]() ![]() |
![]() |
CC0: no conditions |