2. Computer-Aided Design (CAD)#

In this unit, we had to:

  • Design, model, and document a parametric FlexLinks construction kit that we would fabricate the following week using 3D printers.
  • Ensure the design is parametric, allowing for adjustments based on material properties and machine characteristics.
  • Read about Creative Commons open-source licenses and apply a CC license to our work.
  • Complete our FlexLinks kit by incorporating at least one part created by a classmate during the week, acknowledging their contribution, modifying the code, and preparing the parts for printing.

2.1. Getting started, getting OpenSCAD#

On a Ubuntu OS, with a UNIX terminal, there are two ways to download OpenSCAD : yau can either visit the official OpenSCAD website, or use the terminal to execute the command sudo apt install openscad.


2.1.1. OpenSCAD tutorial#

To get used with this new software, there is several resources offered : * The tutorial created by Nicolas De Coster. * The documentation page of OpenSCAD where you can follow the OpenSCAD tutorial. * A youtube tutorial. * Numerous other tutorials available online.

There is also a cheat sheet available to quickly find the most usefull functions.


We will design the FlexLink component known as the “Satellite” Beam. By parameterizing this piece in OpenSCAD, we are able to streamline the design process for the other FlexLinks components.

2.2.1. Technic Beam#

The Technic Beam is designed to resemble a beam with a series of holes along its length. The code leverages OpenSCAD’s difference() function to create the beam structure by subtracting smaller cylinders from a larger one, thereby forming the holes.

$fn = 30;

module holesPiece(height, holes, r_int, r_ext) {
    d_ext = 2 * r_ext;

    difference() {
        // Creates the outer shape of the beam 
        hull() {
            cylinder(h = height, r = r_ext);
            translate([0, d_ext * (holes-1), 0])
            cylinder(h = height, r = r_ext);
        }
        // With difference() will substracts holes in the beam
        for (i = [0 : holes - 1]) {
            translate([0, d_ext * i, 0])
                cylinder(h = height, r = r_int);
        }
    }
}

Code explanation :

  • $fn = 30; sets the number of fragments for circular shapes, ensuring smooth edges.
  • The holesPiece module takes parameters such as height, number of holes, and inner/outer radius.
  • The hull() function is used to create the outer shape of the beam by placing multiple cylinders in a row.
  • The difference() function subtracts smaller cylinders (the holes) from the larger cylinder, creating the desired beam structure.

By parameterizing the dimensions, we can easily modify the design later to adjust hole sizes or spacing.

2.2.2. Hollow Beam#

The Hollow Beam is another essential component that features a hollow center. The design uses the difference() function to carve out an inner cylinder from an outer cylinder, creating a hollow structure.

$fn = 30;

module hollowPiece(height, length, r_int, r_ext) {
    d_ext = 2 * r_ext;

    difference() {
        hull() {
                cylinder(h=height, r=r_ext);
                translate([0, length, 0])
                cylinder(h=height, r=r_ext);
            }
        union() {
            hull() {
                cylinder(h=height, r=r_int);
                translate([0, length, 0])
                cylinder(h=height, r=r_int);
            }
        }
    }
}

Code explanation :

  • The difference() and union() functions are utilized to remove the inner cylinder while keeping the outer structure intact.

2.2.3. Base#

The Base component serves as the foundational piece that connects other parts of the FlexLinks system. This design combines both hollow and holes features, incorporating multiple pieces into one module.

$fn=30;

module base(height, holes, length, r_int, r_ext) {
    union() {
        translate([0,-length/2,0]) {
            hollowPiece(height, length, r_int, r_ext);
        }
        translate([0,length/2, 0]) {
           rotate([0, 0, -45])
               holesPiece(height, holes, r_int, r_ext);
        }
        translate([0, -length/2, 0]) {
            rotate([0, 0, -135])
                holesPiece(height, holes, r_int, r_ext);
        }
    }
}

Code explanation :

  • The base module combines different components using the union() function.
  • We utilize translate() and rotate()to position the hollow beam and two instances of the technic beam at specific places and angles to create a stable base.

2.2.4. Beam#

The Beam is a straightforward geometric piece that serves as a structural element in the FlexLinks kit. It is created using OpenSCAD’s cube() function.

$fn=30;

module beam(height, length, width) {
    cube([length, width, height]);
}

2.2.5. Satellite#

The Satellite component combines the previous elements into a single, cohesive design.

$fn=30;

module satellite(height, beam_length, beam_width, base_holes, base_length, holes_r_int, holes_r_out, tip_holes) {

    // r_dif used to make the Object a valid 2-manifold
    r_dif=holes_r_out-holes_r_int;

    union() {

        base(height, base_holes, base_length, holes_r_int, holes_r_out);

        translate([holes_r_out,-beam_width/2,0]) {
            beam(height, beam_lenght, beam_width);
        }

        translate([beam_length+holes_r_out*2-r_dif/2,0,0]) {
            rotate([0, 0, -90]) {
                holesPiece(height, tip_holes, holes_r_int, holes_r_out);
            }
        }
    }
}

This modular and parameterized approach allows for quick modifications and adaptations of the design, facilitating the assembly of the FlexLinks kit.


2.3. Licensing the work#

To ensure that my work is accessible and can be built upon by others, I opted to apply a Creative Commons license. This license allows others to share and adapt my designs, as long as they provide appropriate credit. I chose the CC BY-SA 4.0 License, which permits both commercial and non-commercial use, encouraging collaboration and innovation within the community.

I added the license information to my project documentation and included a note in my OpenSCAD code to indicate the licensing terms. This not only acknowledges the contributions of others but also reinforces the importance of sharing knowledge and resources in design and engineering.

2.4. Fetching code and modifying it#

Since my study buddy made the same satellite FelxLink, we modified a bit the code to make a piece that will be used in module 3. The piece we created is a platform that will be used to catapult an object vertically. Here is what the piece looks like :

Thanks to the beam and the holesPiece modules, the code for the platform is quickly made like followed :

module platform(height, beam_length, beam_width, holes_r_int, holes_r_out, tip_holes) {
    // r_dif used to make the object a valid 2-manifold
    r_dif = holes_r_out - holes_r_int;

    // union to combine all the components
    union() {
        // Beam in the center
        translate([holes_r_out*2 - r_dif, -beam_width / 2, 0]) {
            beam(height, beam_length, beam_width);
        }
        translate([beam_length/2 + 2*holes_r_out,0,0])
        rotate([0,0,90])
        beam(height,10,beam_width);

        // First holesPiece at the start of the beam
        translate([holes_r_out - r_dif / 2, 0, 0]) {
            rotate([0, 0, -90]) {
                holesPiece(height, tip_holes, holes_r_int, holes_r_out);
            }
        }

        // Second holesPiece at the end of the beam
        translate([beam_length + 3*holes_r_out - r_dif*1.5, 0, 0]) {
            rotate([0, 0, -90]) {
                holesPiece(height, tip_holes, holes_r_int, holes_r_out);
            }
        }
    }
}