# Computer-Aided Design - Week 2
----
## Assignments
> **Computer-Aided Design**
>
> - Model a possible final project (raster, vector, 2D, 3D, render, animate, simulate, ...)
> - Compress your images and videos
> - Post a description with your design files on your class page
## CAD-Software
I tried following CAD-Software (I work under Linux so my choice was a bit limited):
- Onshape (not in depth)
- LibreCAD
- FreeCAD
- OpenSCAD
### Onshape
I didn't like Onshape because of the first quick-start video, which in the first tips for the software was advertisement for sharing the software and to use the mobile app, which scared me a bit and I didn't continue.
I may try it later in a later point but I now like FreeCAD already.
### OpenSCAD
I've designed before a little cover module for my keyboard.
It's a really interesting way to design I really like this programming-way :D

### Blender

Already modeled with blender, but learned new many new things:
#### Findings
##### No Numpad
- preferences -> input -> emulate numpad (1-0 are new numpad keys)
- keymap 'frame select' -> change 3D select with 'Numpad.' to '.' -> orbital change object
- navigation -> zoom to mouse
##### Keymaps
-> mouse buttons AND shortcut depend on the window
- Shift+Drag on window (border) -> new same extra window
- t -> toggle toolbar
- n -> numerical side-panel
- g -> move (grab)
- on top: info for the distance
- in 'g'->'y'->'1'->'Enter' (arbitrary, also negative value)
- numpad 1/3/7 -> front/right/top
- with Ctrl opposite
- s -> scale -> depends on the center of opject (close = big adjust, far = small/precise)
- r -> rotate
- Alt+g/r/s -> resets those settings -> !!ONLY OBJECT MODE!!!
- ctrl+n -> new file
- x/y/z -> use axes
- shift+x/y/z -> move in the plane
- Tab -> toggle between object and edit mode
- c -> paint select (scroll for circle)
- a -> select all, aa -> deselect all
- l -> select object under it
- e -> extrude
- 'origin to geometry' -> sets the origin point
- in the top icons -> change rotation point
###### Edit mode
- 1,2,3 -> change between selection modes
- when moving in edit mode -> topology of selected stuff changes but not origin point!!!
##### Modufier
- Wrench-Icon -> add modifier
- Subdivision surface <5! (else crash)
- more surfaces
- always from origin point
##### Notes
- in move -> middle mouse uses axes
- when inserting an object(so only after add), left bottom a bar is showing for settings
- right mouse button on button -> assign shortcut
- 'Shade Smooth'
- 'Shade Auto Smooth' -> smooth shades above a degree
- middle click toolbar -> drag it
- right-click -> cancle
- atomatically creates .blend1 files (backup) when saving -> higher number == older
- base-unit==mm
- local view -> only show selected (top left indicator)
- last object gets brightest orange
- shift click selection modes -> select them
- everything where you can type a number -> keyframe (animate)
### LibreCAD
I liked working with it, was very intuitiv and easy to learn.

I documented here some findings i had:
[Principles and Practices](./principles_and_practices.md)
### FreeCAD
It was the first time for me using CAD-Software.
#### Findings
[The Tutorial](https://www.youtube.com/watch?v=E14m5hf6Pvo)
##### Constrains
- important to fully constrain -> unconstrained parts can lead to reconstruction errors on model regeneration
- different workbenches for different design methods
- white drawing tools, red constrain tools
- new body -> creates a coordinate system, shown with 'space'
- new sketch -> klick on plane to draw on it
- draw sketch and then apply constrains to it
- drawing on the axes stays on the axes -> 'constrained' to it
- auto-recognizes straight lines -> red line next to cursor
- for constrains (eg. horizontal/vertical line), select stuff and use red icons to apply
- dimension tool for setting length) -> constrains length
- click on line to define dimension
- if something is fully constrained, turns green
##### Variables
- parametric approach -> enable dynamic adjustment
- '{}'-Icon for variables
- create variable for body with name VARNAME
- select sketch again and select dimension to combine the variable with
- double click and select 'fx'-button -> use VarSet.VARNAME
- also possible to use relateive size -> VarSet.VARNAME + 20mm
- dimension with variable turns orange
- create external Geometry -> project object contures for sketch
##### Assembly
- create 'assamble' of an object with many sub objects and just combine with selecting faces/edges
##### Format
- export as .3mf -> better meta data for continous production/verarbeitung
#### Tutorial Outcome
I followed above mentioned tutorial and build this in it:

[Clamp STL](../_static/Test-StemOrigin.stl)
Also with the tutorial from Ferdi, I learn even more about FreeCAD and designing with CAD-Software:

[Lego STL](../_static/FerdiTest-Body.stl)
## Image and Video Manipulations
For image manipulations I tried:
- GIMP
- Inkscape
- Kdenlive (personally tested)
### GIMP
)
#### Findings
- CTRL-Shift-A -> deselect all
- CTRL in path -> change bezier or connect
- left bottom button -> show mask -> edit with brush etc.
##### GIF
- name layers NAME (TIMEms) e.g.: layer_1(100ms)
### Inkscape

#### Findings
- set property/size to machince one
- Ctrl in creating a shape -> snap
- Crtl+Shift in creating an object -> snap + use startpoint as center
- Tab 'Align and Distibute' -> align object relative to another
- Node Tool -> change nodes to be used
- Ctrl+d -> duplicate
- Ctrl+- on selected objects -> remove from each other
- Ctrl+G -> group objects
- Import:
- Embed -> copy in it
- Link -> update if original updates
### Increase smallness of images and videos
For changing videos and images sizes/format, I use `ffmpeg` and `imagemagick`.
Currently I only needed the `magick`-command, e.g.:
```bash
magick INPUT.jpg -fuzz 30% -quality 0.5 -resize 1000 OUTPUT.jpg
# ^^^^^^^^^^^^ resizes the width to this value and changes height accordingly
# ^^^^^^^^^^^^ compression quality
# ^^^^^^^^^ sets the distance, for wich pixels are considered equal
```
## First design files Final Project
First model of the left key made with FreeCAD:
[KeyLeft STL](../_static/FinalProject-KeyLeft.stl)
## Learning Outcomes
- I need a better documentation workflow (document as I go, directly in the right format)
- CAD design principles (completely new to me)
- Inkscape from scratch