Computer aided Design
Summary
My goal for this week are
- Using Inkscape to make a conceptual sketch of my final project
- Using Freecad to
- make a 3D model of the disk dispenser
- create an animation of disk dispenser in action
2D modeling
I started to create a drawing of the sediment trap with Inkscape.
I choose Inkscape because it is an open-source software, broadly used in fab labs and my school.
It allows to create vectorized 2D images.
Its interface is user-friendly and I achieved a decent result (at least for my artistic skills).
Although, I was frustrated by being unable to achieve a realistic look for the top grid.
I miss the option to create constraints between entities (I'm a Solidworks user).
I found out that I prefer to draw conceptual sketches on paper and start to model directly in 3D.
That's what I did with my idea for the disk dispenser mechanism:

Use of IrfanView
I scan my drawing and use IrfanView to crop and compress it in a 100KB JPEG file.
IrfanView is a freeware that I use as image viewer. It has image editing capabilities, such as cropping and rotation.
It also have a conversion tool that allow to save the image in another format.
For the JPEG format, it has an handy option that allows to set the desired file size.
Moreover, it has basic "Paint tools" that I used to add the red ellipse on the screenshot I took from the "JPEG/GIF save options" dialog box.

3D modeling
I already used Solidworks and Fusion360 in previous projects. Hence, I decided to try FreeCAD.
I prefer to use open-source and multi-platform softwares. I also plan to test the Part Workbench to use Constructive Solid Geometry (CSG).
Dispenser body model
I designed the dispenser body as follow:
I started by defining the geometric parameters uin a spreadsheet. Each parameter has a name (used in object definition)and a value. I added its unit and a description for documentation.

I added a tube primitive to start the dispenser body. I used the spreadsheet parameters to define its dimensions.
By default, the center of its bottom side is at the origin of the coordinate system.

I added a cube primitive to create the left rail.

By default, its bottom left corner is at the origin of the coordinate system. To be correctly placed it has to be translated by the inner radius in the negative X direction and half its width in the negative Y direction.

I mirror it across the YZ plane to obtain the second rail.

We still need to combine these 3 objects to create the dispenser body. To do this, we select the Boolean tool in the toolbar. it opens the dialog box shown in the 2 pictures below

in the left picture, the Union operation is selected to be applied to rail 1 and rail 2.
We can see the result of this first operation on the second picture: it created the compound object named Fusion.
I applied the same operation to combine the tube with the combined rails.
I wanted to add a "window"" in the tube, so that the inner mechanism can be seen.
I used the Create Sketch tool to create the shape of this window.
The sketch is composed of 2 arcs and 2 lines, with connected extremities.
I set the following constraints:
- the arcs centers are coincident with the Z axis (2 constraints)
- One the lines is vertical (1 constraint)
- the arcs and lines are tangent (4 constraints)
Combined, with the precedent constraint, it implies that the arcs are half circles and that the lines are equal
- The line length, circle diameter and distance from the origin are defined by the geometric parameters (3 constraints)
This sketch is extruded along its normal axis to create a solid that will be subtracted to the dispenser body

During this operation, I run into a "bug": in the Extrude dialog box, I was unable to enter a parametric expression for the extrusion length.
I had to edit its properties to have the edit an expression... button.
Finally, I applied a Difference operation, subtracting the Window solid to the dispenser body.
Assembly
I also created the rod and a disk using the Part Workbench, in 3 separated files.
FreeCAD allows you to use parameters from one file into another one. For example, I used the outer radius of the dispenser body to set the radius of the disk, with a 1mm margin.
I combined these parts in the Assembly Workbench following these steps:
- the Create assembly tool adds an empty assembly object to the file
- add the 3 parts with the Insert Component tool, the corresponding files needs to be opened
- I started with the body, because the first part is "grounded"
- create a Revolute joint between the body and the rod: select the cylindrical face of the rod and the outer one of the body. It constraints both of them to share their symmetry axis (the Z axis) and prevent any relative movement along this axis.
- create a Sliding Joint between the body and the disk: select the outer cylindrical face of the body and the cylindrical face of the central hole of the disk. The only movement allowed for the disk is a translation along the Z axis
- create a Screw Joint between the rod and the disk: select the previously used faces of the rod and the disk. It links the sliding movement of the disk with the rotating movement of the rod.
Video animation
For the video assignment, I decided to create a video of the movement of the disk.
I tried two methods:
- create a animated gif from screenshots of the mechanism in successive positions
- capture a video of my screen while I use FreeCAD to operate the mechanism
GIF creation
- I added a Distance Joint between the top of the body and the top of the disk to set the position of the disk.
- I change the distance by a 0.2mm increment and take a screenshot of my screen for each step.
- I used ImageMagick to crop the screenshots:
This command crops a 280x345 frame, which top-left corner is situated at (200,50) in the original image.
It applies to all files named anim*.png and save the result in a new file named animc*.png.
The '*' in the filename is a place holder for any number.
- I also used ImageMagick to create a gif:
This command takes all animc*.png files and create a gif with 100ms delay (time is expressed in 1/100th of a second).
The -loop 0 directive tells how many times the GIF file should loop. '0' means forever. That's what you want on a webpage.

CAD files
Here are the CAD files I created in FreeCAD for this week assignment: