Week 2, Computer aided design¶
Assignment¶
- Model (raster, vector, 2D, 3D, render, animate, simulate, …) a possible final project, compress your images and videos, and post a description with your design files on your class page
The options to model are open ended, but I am working to try several different of these.
- Raster
- Vector
- 2D
- 3D
- Render
- Animate
- Simulate
Evaluation Checklist
- Modelled experimental objects/parts of a posssible project in 2D and 3D software
- Shown how you did it with words/images/screenshots
- Documented how you compressed your image and video files
- Included your original design files
Modeling¶
Raster Manipulation¶
As a starting point, I am taking an image from the US Library of Congress free to use set. My starting image is from a 1971 poster of Clenched fist with stars and stripes.
Clenched fist with stars and stripes
I would like to remove the background surrounding the poster. Then, I plan to separate the colors into separate layers, which could be a first step preparing for two color silk screen printing or vinyl cutting. I have done image manipulation in Photoshop and Pixelmator. Due to my past experience, I am doing this in Pixelmator.
In a few steps.
- Crop the background from LOC image.
Cropped out background
- Remove the white. Use the “Select color range tool”, select white, and then “cut” the white.
White remove (to transparent)
- Use the color select tool for blue, cut, and paste into new layer. (White background added in new layer via paint tool).
Viewing the blue layer. Red layer is present but not currently viewed.
- Duplicate the color layers, and convert these duplicates to B&W via color adjustments.
Viewing the blue layer in black and white. The red B&W layers is not currently visible.
This process allows for the two B&W layers to be printed in tranparencies, and subsequently used as a mask for screen printing.
The file with layers that results from these steps. Note, rather than share Pixelmator format, I have saved as SVG. This file was made smaller than the original by using the “Image Size” command in Pixelmator. The original was 1200 dpi, which was changed to 300 dpi.
Vector Manipulation¶
Starting from the same image as the raster work, I am working with Inkscape to make this same image into vector format.
- Import the image into Inkscape
- To make the paths, use “Trace Bitmap” to trace. Since this is a simple three color drawing, choose the “multicolor” tab, and set the number of scans to the number of colors
Tracing the bitmap
- The file can then be saved as an SVG (vector format) file.
Part of the red path has been highlighted. The individual points surround an area filled with red.
As a vector file (SVG), I sent it to my pen plotter. The clear outline of the colors can be seen in the plotting. This is completely analogous to how a vinyl cutter could use this same file for a cut path.
Using the SVG output on a pen plotter
Here is the SVG file that results from the steps above. I used it on the pen plotter, and it can be used for vinyl cutting with little to no modification.
I took the video with my iPhone, and used the following command to convert and compress it from the Apple format to a more universal mp4.
ffmpeg -i INPUT.MOV -vf "scale=640:480" -c:v "mpeg4" -q:v 1 OUTPUT.mp4
This command resulted in video that wasn’t viewable in certain browsers. While I tested it in Safari, it didn’t work in Chrome. Therefore, I used a different compression command.
ffmpeg -i INPUT.mov -vf "scale=640:480" -q:v 0 OUTPUT.mp4
This has resulted in video viewable in Chrome.
Despite my best efforts, each of the above inconsistently played video, and my instructor was unable to view the video. I was confident that I was using commands that should work. Therefore, I suspected that either the input video or the ffmpeg software was corrupted in some way. To try this hypothesis, I transferred the video from my phone again, and also reinstalled ffmpeg
on my computer. I then used the following command.
ffmpeg -i INPUT.mov -vcodec libx264 -b:v 1000k -vf scale=-2:1080 -an OUTPUT.mp4
This resulted in video viewable by my instructor. This command also removed the audio, which I hadn’t done previously. (Even though not specified at the command line, the previous commands noted did result in h.264 output.)
Gear Part Design¶
Working in FreeCad, and basing off a tutorial found online to make a gear. I am starting with a gear because my final project will require wheels and gears to dispense the cards.
Steps:
- Open FreeCAD and create empty file
Opened FreeCAD with new file option.
- New empty file created
Empty file
- Under “Part Design” select involute gear
Part design menu
- Choose number of teeth. Using 24
Change teeth number
- Move to “Part” menu and select extrude. Use 10mm
Extrude options
View of extrusion
- To make axel at center of gear. Add cylinder to object, with same length (10mm). Select gear and cylinder. Use “Boolean/Cut” to remove axel.
Cylinder cut out
- To make 2nd gear. Repeat steps above, though make a 12 teeth gear. Also make the depth 15mm for a thicker gear
Overlayed 2nd gear
- To align the gears, make X offset by the formula (module*(teeth_gear_1+teeth_gear_2)/2)
Offset of gears
- To make the teeth mesh, use the formula (360/number_teeth/2)
Gears aligned and meshed
Here is gear design file from FreeCAD. This is the result from both 2D and 3D modeling.
Rendering¶
To render an object in Blender, I first tried to work with my gear model. The native FreeCAD format is not recognized by Blender. I tried to export as *.stl format. When imported into Blender, there was a gear artifact not present from FreeCAD.
STL gear file imported into Blender
I moved to work from an online tutorial.
The first step is to make a new empty document. By default, there is a cube, light, and camera. Those were all deleted. A mesh monkey was added from the menu.
Add mesh monkey model
Add a point light source
Point light source added
Add a camera
Camera added
Render image with the Render/Render Image menu option
View initial render
The initial render is dim. Then increase the light to 200W. Also change the light color to red.
Increase light wattage
To view the camera position, toggle the camera view
Camera view
Then, make the render by the Render/Render Image menu option. We have a red monkey. Save the file as a PNG.
Red monkey rendered
Here is the monkey design file for Blender.
Summary¶
These design and rendering options were tricky to me, hence I started with simpler tutorials. I believe I’ve gotten some basic seed skills which I can extend and directly apply to my final project.