#lang racket ; This file is a TEMPLATE for the exercise of drawing the Amati violin in "Traité de Lutherie" (pages 114-129). ; The code has a variety of places labelled "..." where you should try plugging in the right expressions. What you ; need to do is look at the description in the book, and then translate it into code. ; There's a "solution sheet" that you can see in the file Amati.rkt, but the exercise is to try filling in the ; blanks without looking. ; HERE'S HOW TO DO IT: ; Notice that the semicolon ";" serves to make certain text comments to the reader (yellow-brown typeface). ; Fill in the ...s from top to bottom. If you run the file as is, you'll get a PDF drawing with the point X only. ; Then put A in place, AND "uncover" the A in the parts list by moving it to the other side of the ; mark. Then ; you'll have X and A. And so on to complete the drawing. ; You have to go back and forth, filling in the definitions, and running the file to see the output. If the ; output looks good, go on. If it looks bad, you need to fix it. With a compass and straightedge, you'd be ; erasing and redrawing. Here' you debug your code, and press "Run" to redraw. (require "Geometry-Engine.rkt") (elaboration #t) (mirroring #t) (arcthickness 1) (arccolor "blue") (title "Violin by Andrea Amati (const. François Denis)") (coded-by "YOUR NAME HERE!") ; Violin by Andrea Amati (define (Amati) ; LAYOUT OF THE AREA on which the curves are drawn... (let* ((xq 208) ;; 208mm in the Amati ; (X (label "X" origin)) ; (A (label "A" ...)) ; (Q (label "Q" ...)) ; (N (label "N" ...)) ; (q (label "q" ...)) ; (qp (label "q'" (mirror q))) ; WHEN YOU "UNCOVER" q, UNCOVER THIS TOO... ; (O (label "O" ...)) ; (Z (label "Z" ...)) ; (P (label "P" ...)) ; (p (label "p" ...)) ; (pp (label "p'" (mirror p))) ; WHEN YOU "UNCOVER" p, UNCOVER THIS TOO... ; (M (label "M" ...)) ; (a (label "a" ...)) ; (b (label "b" ...)) ; (e (label "e" ...)) ; (c (label "c" ...)) ; (d (label "d" ...)) ; (h (label "h" ...)) ; (g (label "g" ...) ; ***** DRAWING THE OUTLINE ***** ; THE LOWER BOUTS... ; (R1lower (circlefrom ...)) ; lower block ; (R2lower (lower-left-flank ...)) ; lower left flank ; (R3lower (left-flush ...)) ; above R2lower, towards corner ; (R4lower (lower-corner ...)) ; corner ; (lower-curve (make-curve ...start, end points... (list ...circles making curve go here))) ; these curves, put together ; THE UPPER BOUTS... ; (R1upper (circlefrom ...)) ; top block ; (R2upper (upper-left-flank ...)) ; upper left flank and corner (why the Amati looks so round...) ; (R3upper (upper-corner ...)) ; corner ; (upper-curve (make-curve ...start, end points... (list ...circles making curve go here))) ; these curves, put together ; THE MIDDLE BOUTS... ; (f (label "f" (xshift e (- (distance X Z))))) ; center of main curve in the C-bout ; (R1middle (circlefrom ...)) ; main curve in the C-bout ; (R2middle (middle-top-corner ...)) ; top arc in curve towards upper corner ; (R3middle (middle-bottom-corner ...)) ; bottom arc in curve towards lower corner ; (middle-curve (make-curve ...start, end points... (list ...circles making curve go here)) ; these curves, put together ) ; Parts list (to be drawn) (list ; X A Q N q qp O Z P p pp M a b e c d h g ; (horizontal N) (horizontal O) (horizontal Z) ; (horizontal P) (horizontal Q) (horizontal X) (horizontal M) ; (vertical p) (vertical q) (vertical b) (vertical e) (line p (mirror q)) ; R1lower R2lower R3lower R4lower ; R1upper R2upper R3upper ; f R1middle R2middle R3middle ; upper-curve lower-curve middle-curve ))) (sketch (Amati)) (end-drawing)