In this lesson, we will get to know basic principles of CAD modelling, and CAM operations.

We will use FreeCAD, an open-source option that is available for all major operating systems, and can be used by anyone that wants to learn how to design and create their designs.

## Types of Design (in CAD)

### CSG
Constructive solid geometry involves combining primitive shapes into forms, joining and intersecting them to create more complex forms.

### B-Rep
Boundary representation is the most commonly used kind of design. In this style, sketches are used to define geometric boundaries via faces, edges, and vertices.

### Polygonal Surface Modelling
Surface modelling relies on meshes, where faces are subdivided into many sub-faces that can be manipulated spatially to create forms.

FreeCAD has support for all three of these methods. In this course we will concentrate on B-rep, as it is the most appropriate for projects such as cabinets, furniture, and other solid models.

### Workbenches
FreeCAD uses a concept of "workbenches" to organize sets of tools used in both CAD and CAM. We will be using workbenches that allow B-rep modelling, and workbenches for taking those models and preparing them for CNC milling.

### Design Workbenches
Part Design - used to organize groups of sketches and apply features to the sketches. Examples include "padding" - giving volume/thickness to a sketch outline, or "pocketing" - removing volume based on a sketch.
Sketcher - provides drawing tools used to create outlines that describe the part we are trying to create.

### Production Workbenches
CAM - used to create all machining operations, based on the design. It includes features for setting stock size, choosing tool bits, setting the speeds of the machine, and outputting g-code for the mill.

## Exercise - Stool Design

For our learning project we will design a small multi-legged stool composed of a top (seat) and at least three joints capable of accepting legs.

### Part 1. Cut the Project

To begin we will jump right into loading up gcode into a gcode sender software and using it to cut a miniaturized model of the design. (For time constraints, half of students will cut the stool top, half will cut legs, and these can be joined together as a group)

### Part 2. Design the Project

Having seen the final output, we now back up to learn how both the CAD and CAM portions of the project were done. This consists of:

* Prep work - get to know the software, learn about important preferences, prepare for CNC milling
* Design - learn about bodies, sketching tools, adding features, and organizing parts
* CAM - learn to set up stock materials in a job, select tool bits, and apply a machining operation, before outputting prepared g-code

## Design Concepts and Terms

### Body (Part Design Workbench)
A holder for design sketches. Every body has an origin that defines where the body sits in space relative to the world origin. It also includes rotational information.
In FreeCAD each body represents a single solid object.
Groups of bodies can be organized as "Part".

Terms:
* Base Feature - if an existing model is used as the basis for a new body, that model is called the "base feature"
* Placement - how the body is positioned in space, including angle, axis, and position
* Pad - thickness created by applying volume to a sketch outline
* Pocket - volume removed from a sketch outline
* Pattern - a feature repeated in the design
* Transform - an offset applied to the placement of a body, changing it's position/rotation

### Sketch (Sketcher Workbench)
The sketch is the core of b-rep modelling. A sketch is a drawing, but what makes sketches in CAD unique is the use of constraint-based modelling.
Constraints define the relationship between the vertices and lines of the sketch. This allows for "parametric design" - sketches that can dynamically rebuild themselves to accommodate design changes.

Terms:
* Attachment - how the sketch is applied to a plane in space (X,Y,Z)
* Map Mode - the relationship of the sketch to the attachment plane (can be flat, perpendicular, etc.)
* Vertice/Node - a point in space, typically used to form "edges" or lines
* Construction Geometry - lines used for layout that are not part of the final design
* Constraints - used to define the size, and position of edges and vertices relative to each other and to the 3D world

### Other Terms

* Varset - parameters for a design that can be used in sketches and features, and can be easily updated

## Exercise Notes

This exercise consists of two parts - a stool top, and a leg (which can be cut as copies to provide however many are needed)

Those parts are each considered a body, and the body's shape is defined by a sketch, to which features such as thickness have been added.

### Top Body
A circular shape defined by a diameter constraint, centered on the sketch origin.
The top has a joint - a mortise, into which a tenon on the leg is meant to insert.
The mortise joint is created by attaching a second sketch to the surface of the top, drawing out the shape of the mortise, then using that sketch as the basis for a "pocket" - a modifier that removes volume from the top part.

A "polar pattern" is used to repeat the mortise around the perimeter of the top, creating as many joints as desired.

### Leg
The leg has a corresponding through-tenon meant to slot into the mortise created in the top body. This tenon is defined in the sketch as "fully constrained" - a sketch that can not be altered. Then, construction geometry is used to define the area in which the shape of the leg can be drawn, as desired.

## Class Notes
Given time constraints, students should design the top of the stool, and create the CAM job for cutting it out. If time allows, they can start on the design of the leg and treat it as a homework assignment.

During assembly, students will become familiar with a limitation of CNC machines, that they can not create an inside corner without a radius (due to being a rotary tool). This can affect joint assembly - possible solutions can be discussed and will be implemented in upcoming classes.