Skip to main content

Week2 - Computer Aided Design

Here are my week 2 assignments

What should I achieve in this week:

individual assignment:

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

Computer Aided Design Notes

CAD - 2D is flat and 3D is volume

2D: raster and scan

  • raster is with pixels
  • scan is converting drawing into 2D display

GIMP: opensoure, editing

PS: commercial tools MyPiant: opensource

imagic Magick: coding to images

images longer, take more space and causing slow speed

  • JPG: compressed
  • PNG: uncompressed

JPG and PNG look perceptually the same, however:

  • PNG is the engineering file, image
  • JPG is using for visual documentation

I can use Terminal(MacOS) to directly change PNG to JPG, and do the compressing, etc:

# convert PNG to JPG:

convert input.png output.jpg

# convert all PNGs to JPGs:

mogrify -format jpg *.png

# convert SVG to PNG at 1000 DPI:

convert -density 1000 -units PixelsPerInch input.svg output.png

# compress JPG to quality 50% width 1000:

convert input.jpg -quality 50% -resize 1000 output.jpg

# compress all JPGs to quality 50% width 1000:

mogrify -quality 50% -resize 1000 *.jpg

Vector tools:

Mods: vector cutting mahcines supported

FreeCAD: modeling tool

Parametric Design: Parametric is one of the keys terms

Parametric Kit: You have one parameter for slot size and the whole design adjusts around that.

3D design:

Maintain the history of how you got the design so you can change it, manage the complexity.

Blender: have CAD extension, for automation

Blender Gallery for human modeling, libraries

2D to 3D ways:

span, loft, shape, CSG, etc - FreeCAD examples

OpenSCAD - program to design

Kokompe - serial input

GrabCAD - share the models

choose which one might be the right one for you

interchange formats

STL - for raw design

There are libraries for FreeCAD.

Game(3D) Unity

VR/AR(3D) 3d Environment

physic engine - one purpose for simulation, let the computing to simluate the anime and don't have to design the anime.

Audio and Video input

Audacity - open phone for COD - audio editing

Kdenlive - video editing

ffmpeg: convert the type of videos


# HTML5 MP4 ffmpeg encoding

# variable bit rate 1080p MP3:

ffmpeg -i input_video -vcodec libx264 -crf 25 -preset medium -vf scale=-2:1080 -acodec libmp3lame -q:a 4 -ar 48000 -ac 2 output_video.mp4

# fixed bit rate 1080p MP2:

ffmpeg -i input_video -vcodec libx264 -b:v 1000k -vf scale=-2:1080 -acodec mp2 -b:a 256k -ar 48000 -ac 2 output_video.mp4

# no audio:

ffmpeg -i input_video -vcodec libx264 -b:v 1000k -vf scale=-2:1080 -an output_video.mp4

# crop size (width:height:xoffset:yoffset):

ffmpeg -i input_video -vf crop=1500:800:200:100 -vcodec libx264 -b:v 1000k -an output_video.mp4

# trim time (-ss start time, -t duration):

ffmpeg -i input_video -vcodec libx264 -b:v 1000k -an -ss 00:00:10 -t 00:00:10 output_video.mp4

# mix audio and video:

ffmpeg -i input_video -vcodec libx264 -b:v 1000k -vf crop=1120:876:0:100 -i input_audio -acodec mp2 -b:a 256k -ar 48000 -ac 2 -ss 00:00:20 -t 00:00:20 output_video.mp4

# crop, pan, composite:

ffmpeg -i input_video_1 -i input_video_2 -filter_complex '[1:v]crop=175:95:930:860[cropout];[cropout]scale=350:190[scaleout];[0:v][scaleout]overlay=10:10[outv]' -map '[outv]' -vcodec libx264 -b:v 1000k -map 0:a -acodec mp2 -b:a 256k -ac 2 -t 00:00:05 output_video.mp4

# numbered images to video:

ffmpeg -r 30 -i %04d.jpg -vcodec libx264 -b:v 1000k -vf scale=-2:1080 -an output_video.mp4

key for 3D design version: the application-level and not the files-level

AI for 2D: Midjournet, etc, noticing copyright

AI for 3D: AI system

Join design will be used in the parametric design

webp (the type to image) - for browser