Week 02. Computer Aided design

Sketch

To make the sketch of my final project, I used GIMP.

I simply had a first layer with the image of the arcade machine whom I liked the design the most and, on a second layer, drew on top of it.

2D

I already used Inkscape and I still use it now and then. It is a free and open-source vector graphics editor, so mainly for 2D drawings. It possesses an interface with various tools.

For example, last year, to celebrate the birthday of a specific event where I work at, I was asked to help make keychains.

I just created and modified a drawing in Inkscape, then export the file into a laser cutter machine. Here is the final result :

3D

I already have a bit of experience with SolidWorks but that was a long time ago and for 6 years now, I've used Autodesk Fusion and it will be the program that I use for 3D modeling for my final project.

We were asked to try some programs, so I chose Onshape and FreeCAD.

To try them, I'm going to create the same 3D model on all three programs : a joystick, 4 buttons and their base.

  1. Onshape

    Onshape is a free browser and cloud-based parametric or direct 3D modeler. Its interface and tools are easy to learn and I've had no problem while making the 3D model.

  2. FreeCAD

    FreeCAD is a free software and open-source parametric or direct 3D modeler. Its interface and tools are easy to learn but for a first time, I had a bit of trouble when I had to add another body to the 3D model but still managed to make it.

  3. Autodesk Fusion

    Autodesk Fusion is a free software (limited features with the free version) and cloud-based parametric or direct 3D modeler. I've used it for the past 6 years so I already know a lot about it.

Animation

I decided to try an animation with the 3D model I used to test the 3D modeling programs, I try first on Autodesk Fusion but its animation feature wasn't very interesting for what I had in mind, so I try Blender.

After importing the STL file of my 3D model that got exported from Autodesk Fusion, I look a lot of Youtube videos and ask ChatGPT to learn Blender.

Here are some tutorials for basic operations :

  1. Ungroup a piece

    My STL file was at first an assembly of 6 pieces, but after importing it in Blender, it was grouped and considered a single piece.

    To separate them :

    1. In Object Mode (Blender has 2 modes : Object Mode and Edit Mode) and "left click" the piece;
    2. Press "Tab" to enter Edit Mode;
    3. Press "P";
    4. Select By Loose Parts.

    My pieces are now ungrouped.

  2. Linking objects

    Now that my pieces are ungrouped, they are all unlinked, whenever I move a piece, it moves alone but I want all of the pieces to follow.

    To link them between each other :

    1. In Object Mode, "left click" the child piece (the extra piece);
    2. Hold "Shift" and "left click" the parent piece (the base piece);
    3. Press "Right click";
    4. Press "Control" and "P";
    5. Select Object.

    My pieces are now linked between each other. If you have more than 2 pieces, do everything again but with the others children pieces, I suggest doing this before going to the next step.

  3. Origin

    Before animating, the origin of the piece I want to animate is not at the bottom and would have made the animation really weird so I need to :

    1. In Object Mode, "left click" the piece;
    2. Select Object (on top of the screen), then Set Origin, then Origin to Geometry;
    3. Press "Tab" to enter Edit Mode;
    4. Select Select Mode : Face then with your mouse, "left click" or select the face you want your origin on;
    5. Hold "Shift" and "S" and select Cursor to Selected;
    6. Press "Tab" to enter Object Mode;
    7. Press "left click" on the piece then select Object, then Set Origin, then Origin to 3D Cursor;

    The origin is now centered at the bottom of my piece.

  4. Animation

    Now for what looks like the hard part but is actually easy.

    1. In Object Mode, "left click" the piece you want to animate;
    2. Press "I" to insert a keyframe (like a checkpoint or save of the animation);
    3. Go forward in the keyframe (bar with numbers at the bottom of the screen, for this example, I chose 10 frames);
    4. Change the parameters in the Object window (on the right of the screen, you can change location, rotation, ...);
    5. Press "I" to insert a keyframe;
    6. Repeat until you reach the end of your desired animation.

    Your animation is now done. You can click play (on the bottom of the screen, above the bar with numbers) to check it.

  5. Rendering

    To render your animation and export it :

    1. Change the parameters in the Output window (on the right of the screen, you can change resolution, frame range, output, ...);
    2. Select Render (on top of the screen), then Render Animation.

    Your animation is now rendered and exported.

The order for everything to work fine is : Ungroup a piece, linking objects, origin (for one piece), animation (for one piece) and redo step 3 (origin) and 4 (animation) for all the other pieces.

Now that this is done, I want to create a GIF out of this animation but Blender can't do that, so I use GIMP and the help of ChatGPT.

I have to rename all the images of the render in a specific way, so I place them in a folder and press "Shift" and "Right click" and press Open PowerShell here.

Type the following line in the terminal that opens :


      $i = 1
      Get-ChildItem -File |
        Sort-Object Name |
        ForEach-Object {
          Rename-Item $_.FullName ("Frame {0:D3} (83ms){1}" -f $i++, $_.Extension)
        }
    

This will rename all of the images like so : Frame 00x (83ms) (with x being the number of the frame and 83 the delay between each frame).

  1. Making a GIF

    To create a GIF using GIMP :

    1. Select File then Open as Layers ... and select all of the files of the render;
    2. Select File then Export As ... and a new window opens;
    3. Uncheck Save Comment, check As Animation and Loop Forever, specify the delay between frames and export.

    Your GIF is finally done.

    To lower the GIF file size, I also use an online GIF compressor (N°1) which is limited to 10 compression per days and later, found online GIF compressor (N°2) that gives more options of compression.

Here's my final animation :

3D model of my final project

To make the 3D model, I'll take inspiration from my sketch (made with GIMP), use Autodesk Fusion and ask ChaGPT typical dimensions for an arcade machine. I start with nothing and add matter into my 3D design and only take of matter for the joystick and buttons.

Here is a GIF showing step by step how I created the 3D model and an image of the final model :

Problems met

  1. FreeCAD and multiple bodies

    It was my first time using FreeCAD and when I tried to add a second piece inside my first piece (in a hole), FreeCAD will let me make a new sketch but wont extrude my new piece. To fix this, I have to add a new body and make a new sketch on it to create a second piece and place it correctly inside the first piece (Onshape and Autodesk Fusion don't have that problem).

Useful files (Click to download)

  1. Joystick 3D file (Onshape, doesn't have a file extension proper to it so here's the stl file)
  2. Joystick 3D file (FreeCAD)
  3. Joystick 3D file (Autodesk Fusion)
  4. Joystick animation file (Blender)
  5. Arcade machine 3D file (Autodesk Fusion)