drawing.lisp 4.06 KB
Newer Older
Dave Cooper's avatar
Dave Cooper committed
1 2 3 4 5 6
(in-package :gdl-user)

(define-object box-with-annotated-drawing (base-object)

  :objects      
  ((drawing :type 'box-annotated-drawing
7
            :dl-objects (list (the box)))
Dave Cooper's avatar
Dave Cooper committed
8 9 10 11 12 13
     
   (box :type 'box 
        :length 10 :width 20 :height 30)))


(define-object box-annotated-drawing (base-drawing)
14
  :input-slots (dl-objects (character-size 15)
Dave Cooper's avatar
Dave Cooper committed
15 16 17 18 19 20 21 22 23 24 25
                (witness-line-gap 10)
                (witness-line-length 15)
                (witness-line-ext 5))
    
  :objects
  ((tri-view :type 'base-view 
              :projection-vector (getf *standard-views* :trimetric)
              :length (half (the length))
	      :width (half (the width))
              :center (translate (the center) :rear (half (the-child length))
				 :left (half (the-child width)))
26
              :objects (the dl-objects)
Dave Cooper's avatar
Dave Cooper committed
27 28 29 30 31 32 33 34 35 36
              :annotation-objects (list (the main-length-dim)))
   

   (top-view :type 'base-view 
	     :view-scale (* (getf (the-child view-contents-data) :view-scale) 0.8)
	     :projection-vector (getf *standard-views* :top)
	     :length (half (the length))
	     :width (half (the width))
	     :center (translate (the center) :rear (half (the-child length))
				:right (half (the-child width)))
37
	     :objects (the dl-objects)
Dave Cooper's avatar
Dave Cooper committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
	     :annotation-objects (list (the top-width-dim) (the top-length-dim)))
   
   
   (main-length-dim :type 'vertical-dimension
                    :pass-down (character-size witness-line-gap witness-line-length witness-line-ext)
                    :start-point (the tri-view (view-point (the box (vertex :rear :top :right))))
                    :end-point (the tri-view (view-point (the box (vertex :rear :bottom :right))))
                    :dim-value (3d-distance (the box (vertex :rear :top :right))
                                            (the box (vertex :rear :bottom :right)))
                    :text-above-leader? nil)
   
   (front-view :type 'base-view 
	       :view-scale (* (getf (the-child view-contents-data) :view-scale) 0.8)
	       :projection-vector (getf *standard-views* :front)
	       :length (half (the length))
	       :center (translate (the center) :front (half (the-child length)))
54
	       :objects (the dl-objects)
Dave Cooper's avatar
Dave Cooper committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
	       :annotation-objects (list (the bottom-length-dim)))
   

   (top-width-dim :type 'horizontal-dimension
                   :pass-down (character-size witness-line-gap witness-line-length witness-line-ext)
                   :start-point (the top-view (view-point (the box (vertex :top :front :left))))
                   :end-point (the top-view (view-point (the box (vertex :top :front :right))))
                   :text-above-leader? nil
		   :flip-leaders? t
                   :dim-scale (/ (the top-view view-scale)))

   (top-length-dim :type 'vertical-dimension
                   :pass-down (character-size witness-line-gap witness-line-length witness-line-ext)
                   :start-point (the top-view (view-point (the box (vertex :top :rear :right))))
                   :end-point (the top-view (view-point (the box (vertex :top :front :right))))
		   :flip-leaders? nil
                   :dim-scale (/ (the top-view view-scale)))



   (bottom-length-dim :type 'horizontal-dimension
                   :pass-down (character-size witness-line-gap witness-line-length witness-line-ext)
                   :start-point (the front-view (view-point (the box (vertex :front :bottom :left))))
		   :end-point (the front-view (view-point (the box (edge-center :front :right))))
                   :text-above-leader? nil
		   :dim-value (the box width)
		   :dim-text-bias :start
		   :flip-leaders? t
		   :outside-leaders? t
		   )



   #+nil
   (bottom-length-dim :type 'horizontal-dimensions
                   :pass-down (character-size witness-line-gap witness-line-length witness-line-ext)
                   :start-point (the front-view (view-point (the box (vertex :front :bottom :left))))
                   :dim-scale (/ (the front-view view-scale))
                   :text-above-leader? nil
		   :flip-leaders? t
                   :end-point (the front-view (view-point (the box (vertex :front :bottom :right)))))

   ))