2. Computer-assisted conception#

Table of Contents

This week I familiarized myself with some 3D printing programs, Mr Terwagne explained compliant mechanisms and I learned what a creative commons licence is and how to use it.

Goals and assignments#

Before class#

Before this week’s classes, we had to install some programs and inform ourselves about compliant mechanisms.
Those programs were :

All of them are of course free and open source.

To learn more about compliant mechanisms, we had to watch this YouTube video from Veritasium. I watched it and trust me, it’s worth it🤓. It shows you a lot of applications and ways to use this new technology, it’s even used as a nuclear defense mechanism !!

In class#

We learned a bit more about compliant mechanisms but first and foremost we learned what is a Creative commons licence and how to licence your work. More on this topic at the end of this documentation.
Then, two assistants from the FabLab came and explained us how to use the 3 programs I showed you before. Here, I will only talk about OpenSCAD because I dont like FreeCAD (watch Patrik Dezséri’s documentation from last year) and Inkscape is just not useful when it comes to 3D printing (it’s more useful for 2D applications like lasercutting, Eliott did this module as module 4).
Our assignment for this week was to make groups of 2-4 students and design a machine. First, every member had to make his own compliant part and then we needed to make a machine that unites all the individual components.
My group colleagues were Ana, Nikita and Timo

Planning of the little group project#

After we made our group, we sat down and did a brainstorming of our ideas. We thought about making a kind of screwdriver and we already had everything planned, but at the end of the class Mr Terwagne told us that we had to incorporate a compliant part in our machine…
We finally took the very innovative and original decision of making a catapult. However, we decided to incorporate a pawl mechanism into our machine. Here is a look at the plan for the mechanism drawn by Ana.


Nikita made the spoon part, Timo the lock for the pawl, Ana did the gear and I did the barrel to attach the rope.

Getting familiar with OpenSCAD and making some pieces#

Here are some links to the cheat sheets and tutorials i used.

First, I wanted to make something easy yet nice. I chose to make a heart. here you can see my code with comments :

//Heart

//Author: Lukas Schieble

//Last modified: 15/10/2023

//License: Creative Commons (CC) BY
/////////////////////////////////////////////////

//nombre de faces d'un cylindre
$fn=50;
//paramètres du problème
h1=2;
r1=5;
h2=6;
l=14.1;
//jusqu'à la ligne 25, je programme le dessus du coeur
//module permet de créer une forme et de la réutiliser après, comme une variable en python
module rond (h1,r1,h2){
    //je fais un demi-cylindre en soustrayant un cube au cylindre
difference(){
cylinder(h = h1, r = r1, center = true);
    translate([3.5,0,0])
    cube([h2,2*h2,h2], center=true);
}}
//maintenant, je translate un demi cercle à gauche de l'axe y et un à droite pour les fusionner
module top_heart (h1,r1,h2){
    union(){
        translate([0,4.5,0])
        rond(h1,r1,h2);
        translate([0,-4.5,0])
        rond(h1,r1,h2);
}}
//maintenant, le dessous. Il s'agit d'un cube tourné à 45° dont j'ai coupé la moitié
module bottom_heart (h1,l){
    difference(){
    rotate([0,0,45])
    cube([l,l,h1], center=true);
        translate([-9,0,0])
        cube([19,30,30],center = true);
    }}
//fusionner les deux (minkowski arrondit les bords, rendu plus beau)
minkowski(){
    union(){
top_heart (h1,r1,h2);
    bottom_heart(h1,l);
    }
    cylinder(h1,0.5);}

See my module 1 in section Steps > some useful programs > sketchfab to see how I made those 3D models appear in my doc

Afterwards, I wanted to start coding for my piece, which was the barrel, as I mentioned before. Here is the code that i made :

//Barrel

//Author: Lukas Schieble

//Last modified: 15/10/2023

//License: Creative Commons (CC) BY
//////////////////////////////////////////////

$fn = 50;
//parameters
h1=4;//hauteur des disques en haut en et bas
d1=20;//diamètre des disques haut/bas
h2=19;//hauteur de la colonne centrale
d2=10;//diamètre de la colonne centrale 
//create the barrel
module barrel (h1,d1,h2,d2){
    union(){
    //upper cylinder
translate ([0,0,20])
    cylinder(h = h1, d = d1, center = true);
    //center part, to roll the string around it
cylinder(h = h1, d = d1, center = false);
    //lower cylinder
cylinder(h = h2, d = d2, center =false);
}
}
//paramètres du trou au centre pour la pièce LEGO
hp=25;//hauteur
lo=4;//longueur
la=1.5;//largeur

//create the pin hole
//le but est de sommer deux rectangles identiques mais l'un ayant subi une rotation de 90°
module cross_pin_attach (hp,lo,la){
    translate([0,0,10])//afin d'arriver jusqu'en haut
    union(){
        cube([lo,la,hp], center = true);
        rotate([0,0,90])
            cube([lo,la,hp], center = true);
    }}
//paramètre et module du trou pour attacher le fil
h3=10;
d3=1.5;
module hole(h3,d3){
    translate([0,7,0])
        cylinder(h = h3, d = d3, center = true);
}

//insert the holes inside the barrel
difference(){difference(){
    barrel (h1,d1,h2,d2);
    cross_pin_attach (hp,lo,la);
    }
    hole(h3,d3);}

Then, I had to design a piece in order to verify which parameters to use for the cross pin hole. For that I slightly modified Victor Depillecyn’s code from last year. He made a similar piece but for pin holes instead of cross axles.

//Pin radius checker

//Author: Victor De Pillecyn

//Last modified: 25/10/2023 by Lukas Schieble

//License: Creative Commons (CC) BY
/////////////////////////////////////////////////


//ANCHOR parameters
UNITS = 7;
UNIT_WIDTH = 7.8;
UNIT_HEIGHT = 9.6/2;
PIN_RADIUS = 4.8;
// Other parameters
error=0.01;
$fn = 100;
//import cross pin module
module cross_pin_attach (hp,lo,la){
    union(){
        cube([lo,la,hp], center = true);
        rotate([0,0,90])
            cube([lo,la,hp], center = true);
    }}
// Code to generate a part with increasing pin radius (0.1)
anchorpart(UNITS, UNIT_WIDTH, UNIT_HEIGHT, PIN_RADIUS);

module anchorpart(units, unit_width, unit_height, hole_radius) { 
difference(){
    hull(){
        for (i = [0:units-1]){
            translate([unit_width*i, 0, 0])cylinder(h=unit_height, r=unit_width/2, center=true);
        }
    }
    for (i = [0:units-1]){
            translate([unit_width*i, 0, 0])cross_pin_attach(hp = unit_height+error, lo = hole_radius+(i*0.1), la = (hole_radius+(i*0.1))/2.67);//2.67 est le ratio officiel LEGO pour le rapport largeur/longueur de leurs axes en forme de croix
    }
}};

And, last but not least, I realized that I had not made a flexible piece, so I chose to invent a simple, 90° bent FlexLink. Here is the code :

//compliant piece idea

//Author = Lukas Schieble

//Last modified: 15/10/2023

//License: Creative Commons (CC) BY
/////////////////////////////////////////////////
$fn=100;//those parameters are from the LEGO website (in mm)
r1=20;
eps=1;
h=1.5;
r=2.5;
module subtract(){//This is to make a 1/4 arc instead of a full 360° one
    union(){//those are basically just 2 huge cubes together in the negative x and y directions to remove that part from the arc
        translate([0,-20.5,-5])
        cube(42);
        translate([-20.5,0,-5])
        cube(30);
        }    }
module arc (r1,eps,h){//here i'm subtracting 2 cylinders, one slightly smaller than the other, so i make my arc
    difference(){difference(){
    cylinder(h = h,r = r1,center=true);
    cylinder(h = h+eps,r = r1-eps,center=true);
    }
    subtract();//I'm subtracting the 2 cubes so I have a 1/4 arc
    }}

module hole_attach(r,eps){//this module parametrizes 2 holes to put a LEGO piece inside
translate([r,0,0])
difference(){
    difference(){//2x difference to make the 2 holes
hull(){//hull smoothly unites 2 cylinders
    cylinder(h, r+eps, r+eps, center = true);
    translate([8,0,0])
    cylinder(h,r+eps,r+eps,center = true);
    }
  cylinder(h+eps, r, r, center =true);}
  translate([8,0,0])
  cylinder(h+eps, r, r, center =true);}
    }
union(){//unites the 2 hole ends with the arc
union(){
    translate([0,-19.7,0])
    hole_attach(r,eps);
    arc(r1,eps,h1);}
    rotate([0,0,90])
    translate([0,19.3,0])
    hole_attach(r,eps);}

Sidenote on parametrization#

OpenSCAD is perfect for parametrization, if you define variables at the beginning of your code and use them throughout the code, you can easily change your whole piece just by modifying those parameters at the beginning. This is important because you’ll notice that the first printing will never be perfect and that you’ll need to modify small parameters to improve your piece.
The parameters I used were inspired by this image found on the LEGO website because our catapult is mainly built with LEGO pieces so it has to fit with our 3D pieces.

Licensing the work#

To license your work, it’s actually pretty straight-forward. Here are examples of the existing types of Creative Commons licences, you’re free to choose the one that fits best to your work. I personnaly chose CC-BY, which allows the people to do whatever they want with my work if they credit my work. Here are the different types of CC licenses explained :

In my case, I licensed my work following this pattern :

//Title

//Author : Name Surname

//Last modified : dd/mm/yyyy

//License = Creative Commons (CC) BY
///////////////////////////////////////////////////