Skip to content

Week 02 - Computer-Aided Design

Here are the assignments of week 02.

  • Model (raster, vector, 2D, 3D, render, animate, simulate, ...) a possible final project
  • Compress your images and video
  • Post a description with your design files on your class page

As I'm already quite familiar with Solidworks, Fusion360, Inventor and AutoCAD, I'm going to try some new software. As I use very little parametric design on a daily basis, I will focus on that both in 2D and 3D software.

Raster and vectors graphics

I like projects with an actual purpose so when thinking about a project with raster and vector images it came into my mind to prepare for next week and make vector cutting file from a real world object. I need new gaskets for my free-wheel hubs, so I used my office scanner to generate some raster image (scan) of the parts involved. The gaskets itself were damaged, so I needed to scan the actual sealing surfaces and go from there.

Raster image

Here is a screenshot after scanning the parts in grayscale 300dpi and opening in paint.net.

paint.net scan

Then I did some cleaning and enhancing. The magic wand did a lot of the work and the rest could be done with hand tools.

paint.net cleaning

Vector image

Now it was time to open Inkscape and try to convert the outlines of my raster scan to vector lines. It can be done either by hand or using the Trace Bitmap function.

I realized, that the outline created by the tracing tool where not actual lines, but filled shapes. So I had to fill the internal geometry with the bucket tool and create a new body, which's filling I then set to transparent and added an outline of 0,1mm width.

Here are the three steps:

Inkscape trace

The second part I tried tracing by hand. That isn't difficult for simple parts like this and will be more accurate, as you can create perfectly straight lines or round circles. It's good having a caliper at hand to verify the dimensions with measurements and type in the size of the objects you are placing on the drawing.

Free-wheel hub

I added and aligned the inner and outer circle and one hole. Then I watches this tutorial to learn how to make a circular pattern.

Tip

Hold CTRL when rotating an object to rotate in 15° steps and use SPACE to place a copy.

Next I added also the pockets, using a BSpline and repeating the pattern. (Yes, there are only five pockets)

Inkscape pattern

Pros

Inkscape is a very powerful tool for manipulating vector graphics. It's best for graphic design.

Cons

Inkscape might not be the best tool for drawing technical objects. At least I would rather recommend using a CAD tool for tracing applications, where the dimensions need to be accurate.

2D CAD software

First I thought if there where some features in InkScape, that might be worth exploring, but when searching on the web I got the confirmation, that InkScape is not a suitable tool for 2D CAD.

LibreCAD

Then I found LibreCAD, which is a free, open-source 2D CAD software. I think it's the counterpart to the commercial 2D CAD software AutoCAD.

So setting up was easy and I found the interface quite clear and appealing.

As I don't want to search for icons all the time I quickly identified the commandline, but looked up the user guide to see how the commands look like and also learn about other features.

Tip

You can use commands without having to press ENTER or SPACE when you activate the Keycode Mode - by clicking on the button on the right end of the command line.

When browsing the menues I found that some interesting plugins already come with the software, including a gear generator (for external spur gears only).

So I started creating different layers in the layer tree and then created some geomoetrical object, using both the commandline and the mouse. That wasn't too complicated, but some commands I had to look up to understand fully, as the trim function and how to create the circular pattern, which is integrated into the rotate function.

Next I wanted to add some dimensions, but when adding dimensions, instead of numbers, only empty rectangles appeared. This is because dimensions aren't shown in Draft mode so I had to leave it via the View menu.

LibreCAD

The logical next step is to try to make this part parametric, so I searched for it in the user guide, but couldn't find anything. Then I had to learn, that there is no option for parametric design!

(There is actually a feature request for it, but it was created in 2013 and not much seems to have happened since then. )

Now, that is quite disappointing. I was hoping to use LibreCAD for next week's assignment, but that's not going to happen.

Pros

LibreCAD is very clean and lightweight. I might use it in the future for manipulating simple 2D drawings.

Cons

LibreCAD is not a parametric 2D CAD software.

Solid Edge 2D drafting

Now, learning from the previous attempt and my optimistic assumption that parametric design would be some kind of a standard feature - almost the only software I found, when searching specifically for a free, parametric 2D CAD software, is Solid Edge 2D drafting by Siemens.

The first thing I noticed is the immense size of the installation file, which is 3.9GB compared to LibreCAD being only 25,5MB. I'm very curios about what this software contains...

The first thing I noticed, is that you start drawing on a sheet of paper rather then in open space - but that doesn't make a huge difference. The commands are all very intuitive and the snap and dimensioning features work smoothly. This is actually much more userfriendly then LibreCAD and creating the same drawing took a lot less time. There is a field for searching for commands, which worked very well in helping me find the Circular pattern function.

One negative thing I noticed, is that when adding Smart Dimensions to a circle the Ø symbol for the diameter is not created automatically, as was done in LibreCAD. You have to add it manually using the Prefix button when editing the dimension properties. Maybe that can be fixed in the program settings?

You can tell immediatly from the menues and the options available, that the background of the software is production and manufacturing, so it's very easy to add tolerances, weld information and much more.

Ok, here is the same drawing as before, with dimensions.

Solid Edge 2D

Now let's try making this part parametric. I want to control the number and length of the arms and their width. The size of the thru holes will adapt, as the width changes. The center part will stay the same.

The table containing the variable can be found under Tools - Variables and is quite self-explaining. The dimension are already there and their names can easily be changed to get a better overview.

Because I wanted to make the number of arms variable, I started again and built up one arm and made it parametric.

One arm parametric

Then I created a circular pattern.

Circular pattern fail

Some new dimensions were created and some of them are orange. The number of instances also doesn't appear as a variable. That's not good! When changing my variable only the upper arm changes, but not the others.

After playing around for a while and trying to simplify the pattern, I had to realize that pattern (and mirror as well) only create a group of copies, but all relationships to the original objects are lost.

So with quite some time spent on trying to get this to a satisfactory end, I managed to make a parametric drawing, where I can adjust the length and width of the arms and the thruholes and radii will follow. However, I had to give up on making the number of arms parametric and as you can see, it's not an efficient way to do it, because of all the additional constraints involved.

Parametric design

Pros

Solid Edge 2D Drafting has a very intuitive and user-friendly interface. It contains good tools for creating technical drawings. It also has the option for parametric design using a variable table.

Cons

Solid Edge 2D Drafting struggles with constraints and relationships with object patterns or mirror. Some important features are missing to make this a powerful tool for parametric 2D design.

3D CAD software

Next I wanted to try some new 3D CAD Software.

FreeCAD

I heard that FreeCAD has greatly improved over the last years so let's try how the 1.0 version performs.

The setup was easy and the program is very ligthweight and said to run without trouble on fairly old computers.

The GUI is quite intuitive and I had no issues to get going with the first sketch. I wanted to get directly into parametric design and found a tutorial for that.

You have to select the spreadsheet workbench to create the table for the parameters.

Remember to use the alias field to name the values and select the proper units for beeing able to reference them while dimensioning using the "=" key.

Now that was quick and easy.

FreeCad parametric design

Ok, so next I would like to try a bit more complicated part - something that isn't hard to machine in a 4-axis CNC lathe, but not so trivial to draw in 3D CAD.

I was looking for a function to wrap a sketch around a cylindrical face to create a milled groove to subtract by a boolean operation.

Excecuting that idea was far from intuitive and I found a tutorial that helped me out, but still it took several hours and was quite frustrating. First it's important to know, that this isn't possible with FreeCAD as it comes. I had to install the Curves workbench via the Addon manager. There is the option to map a sketch on a surface. The dotted frame is the projected surface you selected, but the orientation is rotated by 90° at least in my case.

Here you can see the hollow spindle and the groove as a sketch.

Free CAD sketch on surface

I very frequently had trouble with constraints causing errors, even though I'm pretty sure that I wasn't violating any rules. You can get quite frustrated, when the screen fills with 290 error messages caused by adding one final dimension to eliminate the last DOF.

Free CAD error

Anyway, after way to much time spent on this attempt I got a satisfactory result.

Free CAD Millturn

Here is also a small animation of the part, created with the turntable view.

Pros

Free CAD is capable of parametric design and quite lightweight in operation. Because it s open-source you can find useful addons that increase the functionality.

Cons

Free CAD is oversensitive towards constraints and dimensions, causing frequent errors that take a lot of time to resolve. I found it intuitive on a low level, but advanced operations cost lot of time and effort and are much less straight-forward then in commercial 3D CAD software. I also had several issues with "Access violation" errors causing Free CAD to crash.

Autodesk Meshmixer

I thought that it might be a good idea to try at least one tool that focuses on manipulating mesh files. I selected Autodesk Meshmixer as I had used it to a very limited extend some years ago and felt that I would like to learn more about it's capeabilities and limits.

One interesting feature I discovered on this page is creating an organic shell from a surface body. This feature might be useful one day.

After importing the object, go to Edit - Make Pattern. I used the Dual Edges type with tiling mode Hex grid.

Here is a Meshmixer example file with the shell, using also a grid smoothing effect.

Meshmixer shell

So I tried with another, more technical object. I got this model of a link on my computer and I was going to use the same procedure, but it didn't work to begin with. After playing around with the settings for a while, but still couldn't produce any meaningful result I tried to simplify the mesh. It consisted of way too many triangles, as I used my standard export settings for 3D printing.

Meshmixer no pattern

I did this by selecting the object (select double-click) and then select reduce and allow a maximum of 1000 triangles (they where 29210 before as you can see in the lower right corner).

Meshmixer link

I wonder if I could make the sleeve surface more solid?

One way I found is to use the generate face groups function to reduce only the number of triangles in the outer shell. This function seems to change the former solid body into a surface body - so that's why the mesh is not filling the body as before.

That's propably not the best way to do it, but I will stop here.

Meshmixer link 2

Pros

Meshmixer has some interesting features for manipulating mesh objects and 3D printing preparation. It might be useful for the 3D scanning assignment.

Cons

Meshmixer is not very intuitive and the different parameters of the functions are not explained in the software e.g. with tooltips. The manual is quite basic and doesn't cover all the details.

OpenSCAD

Last but not least, I wanted to try OpenSCAD. I found it to have a very good documentation and tutorial directly on the webpage including also a cheatsheet with the functions and commands.

Once you get used to it, simple parts are easily made. I drafted a base for the strain plate of my final project with a clamp mount for a 1'' pipe. The clamp has seats for hex nuts and a cylindrical countersunk for socket head bolts (M5).

Tip

There is now command to create a hexagonal prism, but you can use the cylinder command by restricting the number of faces used to interpolate the curved outer surface. That is a crazy workaround.

It is quite impressive, that drawing this part only requires 20 code lines.

However, if for example I would like to add fillets to the part to make it more stress friendly - things would get quite complicated and time consuming. Nevertheless, I have to admit, that I like this software, it's simplicity and the geometrical imagination required.

OpenSCAD

Pros

OpenSCAD is raw and beautiful. I got used to it quickly and the documentation is really good. It's lightweight and yet powerful. It requires more brain capacity then other CAD software I have tried.

Cons

OpenSCAD is propably not the software to design many and/or complex parts and it only allows export as stl file.

Images and videos

Here is a quick description on how I worked with images and videos.

Screenshots

For screenshots I use Greenshot.

Compressing and editing images

I like paint.net as an image editor. It offers all the basic functions I need including the resizing of images, adding arrows or boxes, highlighting, removing background, blurring and much more.

For this webpage I usually resize the screenshots to a width of 1000px and save them as png or jpg.

PNG? Isn't that creating unnecessary large files?

Well, it depends. Here is an example of a screenshot from week 01. As it doesn't contain a lot of colours you can select a lower bitrate when saving as png. Here I used 8 bit. Now let's compare it to jpg. When saving with 80% quality the image is a little more blurry and has a considerably larger file size. When decrasing the quality to 50% to reach a similar file size, the readability of the text is definitely worse.

Maybe I miss something, but for screenshots I don't really see the advantage of jpg. For photos it's of course a different story.

Paint.net png vs jpg

Screen recording

I used vokoscreen to record the video above. It's nice being able to set a timer and a duration for the recording.

Otherwise there is not much to say about it, apart from that I used the recommended codec h.264 and resolution of 1080p.

voko

Video compressing

For compressing the video for the website, I used Handbrake.

A good thing about Handbrake is that you can also trim the video by selecting Seconds instead of Chapter.

The original screen record from above was 4,11MB and reduced to 502kB (4s trimmed of).

Handbrake

Design files

The design files of this week can all be found in the cad folder of my repository, except for the Meshmixer files, that are both >10MB.