**ENGR 052: Algorithmic design of structures** **Spring 2020** **[Matt Zucker](../index.html)** | Lecture: | Mon 1:15-4:00PM, Singer 221 | |---------------|-------------------------------------------| | Office Hours: | Wed 2:30-4:00PM, Fri 10:30AM-noon, Singer 235| This class is about both the practice and the inner workings of Computer-Numerical-Controlled (CNC) Machining. Similar to my other electives of Mobile Robotics and Computer Vision, this class will reveal how combining mathematical programming with hardware in the real world can lead to both useful and beautiful results. The class will address three broad themes that we will encounter more or less in sequence: * *Basics of CAD, CAM, and machining*, encompassing 2D and 3D computer-aided design, operations for computer-aided manufacturing, and fundamentals of machining such as feeds and speeds, along with a smattering of mechanical design principles. * *Fundamentals of computational geometry*, including polygon clipping, boolean operations on polygons, and polygon offsetting. These foundational algorithms will allow us to implement many of the basic operations that expensive CAM software packages provide. * *An introduction to procedural and generative design*, in which the role of the human designer is complemented or replaced by a computer, allowing the evolution of complex forms that would be difficult or impossible to produce through traditional methods. By the end of this course, you will not just understand how to *use* state-of-the-art CAD/CAM software -- you will begin to have a working understanding of how to *write* your own. # Requirements **Prerequisites:** Either ENGR 15 or ENGR 19. MATH 27 or 28 is strongly recommended. **Skills:** In practice, I expect you to understand elementary programming concepts, including basic loops, functions, and array processing. I also expect you to be comfortable with [linear algebra concepts](../linalg-reintroduction.pdf), especially the ideas of representing points as vectors, and operations on points as matrices. **Time:** I expect students to spend approximately 8 hours per week on this class (4 classes × 8 hours per class + [8 hours for paid student work](https://www.swarthmore.edu/student-employment/employment-faqs) = 40 hours). Although this figure will vary from individual to individual and week to week, you should plan to commit several hours outside of class to homework, reading, and projects each week. # Resources **Piazza**: We will use [this Piazza group](http://piazza.com/swarthmore/spring2020/engr052) throughout the semester to communicate course announcements and answer questions. Please use Piazza (instead of just emailing me) for all course-related communications -- this allows students to see common problems and to engage in discussions about course material. **References**: As the course progresses, I will continue to update this section with useful references. * G-Code: * [G-Code reference on Wikipedia](https://en.wikipedia.org/wiki/G-code) * [LinuxCNC Documentation (see G Code Programming)](http://linuxcnc.org/docs/html/) * Hardware: * [Carbide 3D Nomad 883 Pro](https://carbide3d.com/nomad/) * [Carbide 3D speeds and feeds reference](https://docs.carbide3d.com/support/supportfiles/Nomad883_feeds_125.jpg) * [Fusion 360 Tool Library with speeds and feeds for Renshape](E52%20Nomad%20Tools%20Renshape%20F360.json) * [Camotics Tool Library](E52%20Nomad%20Tools%20Camotics.json) * [Tools spreadsheet](https://docs.google.com/spreadsheets/d/1A7A4ad7Qhkqc9WTOMMu3NmHZirH3NiJScrk4mw1Erjw/edit?usp=sharing) * [HAAS Minimill](https://www.haascnc.com/machines/vertical-mills/mini-mills/models/minimill.html) * [Mill operator's manual](https://www.haascnc.com/content/dam/haascnc/en/service/manual/operator/english---mill-ngc---operator%27s-manual---2019.pdf) * [Fusion 360 Tool Library with speeds and feeds for aluminum](E52%20Haas%20Tools%206061%20Aluminum%20F360.json) * [Camotics Tool Library](E52%20Haas%20Tools%20Camotics.json) * General feeds and speeds: * [FSWizard](https://app.fswizard.com/) * SVG: * [SVG 1.1 specification](https://www.w3.org/TR/SVG11/) * [Section 8: Paths](https://www.w3.org/TR/SVG11/paths.html) **Software installers**: * [Autodesk Fusion 360 educational license sign-up](https://www.autodesk.com/products/fusion-360/students-teachers-educators) (choose the create account link) * [Camotics installer](https://camotics.org/download.html) * [Instructions for setting up Python](install_python.html) **Misc. links**: * [Guerrilla guide to CNC machining, mold making, and resin casting](http://lcamtuf.coredump.cx/gcnc/) * [Nervous System Design Studio - projects](https://n-e-r-v-o-u-s.com/projects/) # Assignments Short design and programming exercises will be assigned weekly. There will be three larger projects/labs which are both more open-ended and more programming intensive. These projects and labs are self-scheduled, which means I expect you and your lab partner to find time to complete them on your own. I am happy to give advice about homework and projects during office hours, and I can also meet with students or pairs outside of office hours by appointment. Grading will follow approximately the divisions shown below: * Homework: 50% * Projects/labs: 45% * Participation: 5% Project feedback will be delivered in-person. I will be soliciting your availability to meet around the deadline of the first project. ## Collaboration and attribution * Feel free to collaborate with your classmates on homework; however, you must submit your own work. Duplicating others’ assignments verbatim (especially code!) is prohibited. * If you do discuss homework with your classmates, I expect you to disclose any such collaboration clearly in your submitted work. Err on the side of caution – it’s the best way to avoid awkward conversations about suspicious similarities between assignments. * Cite any external sources used, including the textbook, internet, discussions with other professors, etc. * Aside from raising technical and procedural questions on the course Piazza, do not collaborate on projects with others outside your group. * Do not post homework or project solutions on Piazza. Questions or answers that discuss solutions too closely will be deleted. Aside from the course-specific policies above, you are expected to understand and abide by the college's [policy on academic misconduct](https://www.swarthmore.edu/student-handbook/academic-policies#academic_misconduct). ## Late policy Homework will generally be assigned soon after class, and due at the start of class the following Monday. Homework assignments may be turned in up to a week late for half credit. Students get one free late homework turn-in without penalty. Late projects which have not been excused in advance may be strongly penalized. I will try to accommodate you in extraordinary circumstances, *especially if you contact me ahead of time*. # Accommodations If you believe you need accommodations for a disability or a chronic medical condition, please email Student Disability Services at email@example.com to arrange an appointment to discuss your needs. As appropriate, the office will issue students with documented disabilities or medical conditions a formal Accommodations Letter. Since accommodations require early planning and are not retroactive, please contact Student Disability Services as soon as possible. For details about the accommodations process, [visit the Student Disability Services website](http://www.swarthmore.edu/academic-advising-support/welcome-to-student-disability-service). You are also welcome to contact me the faculty member privately to discuss your academic needs. However, all disability-related accommodations must be arranged, in advance, through Student Disability Services. # Schedule The topics below are subject to change. Please check this page regularly for updates. January 22, 2020: Introduction Topics: * Course overview, show & tell * CAD & CAM demos * Introduction to G-Code Assignments: * [Homework 1](homework1.html) January 27, 2020: CAD; Computational geometry; SVG Topics: * CAD tutorial * Introduction to computational geometry: convex hull problem * Scalable Vector Graphics format * Project 1 assigned Assignments: * [Homework 2](homework2.html) * [Project 1](project1.html) February 3, 2020: Feeds & speeds; CAM Topics: * 2D convex hull, cont'd. * Machining feeds & speeds * CAM tutorial * CNC demo on Nomad 883 Pro Resources: * [Feeds and Speeds Slides](https://docs.google.com/presentation/d/1Y3ugBFFcS-pA6eNSAaVVUjS3ZjatUkf_hRiDfrNBsrU/edit?usp=sharing) * [E52 Class Widget CAD Only.f3d](E52%20Class%20Widget%20CAD%20Only.f3d) Assignments: * [Homework 3](homework3.html) February 10, 2020: CNC demo; project work Topics: * CNC demo on Nomad 883 Pro * Project work and check-in Resources: * [E52 Class Widget Cam Tutorial.f3d](E52%20Class%20Widget%20Cam%20Tutorial.f3d) * [e52_widget.nc](e52_widget.nc) Assignments: * No homework 4: continue work on your project February 17, 2020: Offsetting convex polygons; lead-ins/-outs Topics: * Lead-ins and lead-outs: arcs * Computational geometry: * representations of lines in 2D * tangents and normals of lines * offsetting convex polygons Resources: * [Lead-in and lead-out demo.f3d](Lead-in%20and%20lead-out%20demo.f3d) * [leadinleadout.nc](leadinleadout.nc) Assignments: * [Homework 5](homework5.html) - note there was no HW4 February 24, 2020: Project 1 presentations Topics: * Project 1 presentations * Machining materials: aluminum * Ramps and helical ramps Resources: * [ramps testing.f3d](ramps%20testing.f3d) * [ramp_contour.nc](ramp_contour.nc) * [ramp_pocket.nc](ramp_pocket.nc) March 2, 2020: Working on the Haas Topics: * Project 2 introduction * CNC demo on HAAS * CAM: Inner pocketing convex polygons Resources: * [E52 Haas operating instructions](E52%20Haas%20Operating%20Instructions.pdf) * [E52 sample aluminum widget](E52%20sample%20aluminum%20widget.f3d) Assignments: * [Project 2](project2.html) (March 9, 2020): Spring break (March 16, 2020): No class due to COVID-19 March 23, 2020: Voronoi diagrams and L-systems Topics: * Computational geometry: Voronoi diagram (glossed but not detailed) * Procedural generation: L-Systems Resources: * [`lsystems_v1.py`](lsystems_v1.py) (live-coded on March 23) * [`lsystems_v2.py`](lsystems_v2.py) uses recursion instead of iteration March 30, 2020: Project 2 presentations; STL handling in Python Topics: * Matt's Spring Break project * Project 2 presentations * STL handling in Python Resources: * [`stl_format_demo_loops.py`](stl_format_demo_loops.py) (similar to what was live-coded in class) * [`stl_format_demo_vectorized.py`](stl_format_demo_vectorized.py) * Example STL files: * [`cube_ascii.stl`](cube_ascii.stl) * [`cube_binary.stl`](cube_binary.stl) * [`bunny-low-poly.stl`](bunny-low-poly.stl) from [here](https://www.thingiverse.com/thing:151081) April 6, 2020: Reaction-diffusion Topics: * Procedural generation: Reaction-diffusion * CAM: Parallel toolpaths * Project 3 assigned Resources: * [Karl Sims](https://www.karlsims.com/rd.html) and [Robert Mufano's](http://mrob.com/pub/comp/xmorphia/index.html) reaction-difusion pages. * [`reaction_diffusion.py`](reaction_diffusion.py) (kind of live-coded in class) * [Matt's personal "final project" code](https://github.swarthmore.edu/mzucker1/e52_python_cam) (Swarthmore login required) Assignments: * [Final project](finalproject.html) April 13, 2020: Texture toolpaths Topics: * Texture toolpaths Resources: * [`carve_texture.py`](carve_texture.py) - based on live-coding in class, depends on [`simple_gcode.py`](simple_gcode.py) from Homework 1. * [VCarve Pro texture toolpath docs](https://docs.vectric.com/docs/V9.0/VCarvePro/ENU/Help/Toolpaths/Texture%20Toolpath/Texture%20Toolpath.html) April 20, 2020: Fusion 360 API & Mesh processing Topics: * [Fusion 360 Python API](https://autodeskfusion360.github.io/) * Working with meshes in Fusion 360 Resources: * [`sprocket.py`](sprocket.py) - live-coded in class April 27, 2020: TBA Possible topics: * Machining: cutting tool geometry * Mechanical design basics - fits, tolerances, fasteners * More 3D toolpaths * V-Carving and engraving toolpaths * Molds and casting * Design for manufacturability * ???