Bell

From MHCGraphics

Jump to: navigation, search
; Mead example file -- a Bell based on Bezier curves
;
; Jim Teresco
; Computer Science 110
; Mount Holyoke College
;
; $Id: Bell.scm 612 2008-04-06 01:19:20Z terescoj $
;
(require (lib "Defs.ss" "Mead"))

; a bell-shaped outline (for a very small bell)
(define bellOutline
  (2to3d '(
           ; first, a straight line from the origin
           (0 0) (0 0) (1 0) (1 0)
           ; now, the curves to draw the bell shape
           ; we repeat the connecing point
           (1 0) (1 .25) (.5 .2) (.5 .6)
           ; repeat, and in this case, colinear control
           (.5 .6) (.5 1.05) (.4 1) (0 1)))
  )

; Lathe it!
(object solidBell Lathe
        (profile bellOutline)
        (bezier)
        )

; Let's hollow it out
(object bell Difference
        (add solidBell)
        (add solidBell
             (compose
              (scale .95 .95 .95)
              (translate 0 -.01 0)
              )
             ))

(tell scene
      (add bell yellowPlastic
           (scale 100 100 100))
      (add bulb (translate 0 50 0)) ; inside!
      )

(tell image
      (background white)
      )

(tell camera
      (pos '(0 300 -500))
      (shoot)
      (pos '(0 -200 -400))
      (shoot)
      )
Personal tools