
(/VERSIONCHECK 2) 

(DEFUN |VIEW3D;checkViewport| (|viewport| $)
  (PROG (|i|)
    (RETURN
      (SEQ (|sockSendInt| |$ViewportServer| (QVELT |viewport| 0))
           (LETT |i| (|sockGetInt| |$ViewportServer|)
                 |VIEW3D;checkViewport|)
           (EXIT (COND
                   ((< |i| 0)
                    (SEQ (QSETVELT |viewport| 0 0)
                         (EXIT (|error| "This viewport has already been closed!"))))
                   ('T 'T))))))) 

(DEFUN |VIEW3D;arcsinTemp| (|x| $)
  (COND
    ((< |x| 1.0)
     (COND
       ((NULL (< -1.0 |x|))
        (/ (SPADCALL 3 (FLOAT PI MOST-POSITIVE-DOUBLE-FLOAT)
               (QREFELT $ 27))
           2))
       ('T
        (SPADCALL
            (SPADCALL (SPADCALL |x| (QREFELT $ 28)) (QREFELT $ 29))
            (QREFELT $ 17)))))
    ('T (/ (FLOAT PI MOST-POSITIVE-DOUBLE-FLOAT) 2)))) 

(DEFUN |VIEW3D;arctanTemp| (|x| $)
  (SPADCALL (SPADCALL (SPADCALL |x| (QREFELT $ 28)) (QREFELT $ 30))
      (QREFELT $ 17))) 

(DEFUN |VIEW3D;doOptions| (|v| $)
  (PROG (|st|)
    (RETURN
      (SEQ (QSETVELT |v| 2
               (SPADCALL (QVELT |v| 12) "FriCAS3D" (QREFELT $ 34)))
           (LETT |st|
                 (SPADCALL (QVELT |v| 12) "wireMesh" (QREFELT $ 35))
                 |VIEW3D;doOptions|)
           (COND
             ((OR (EQUAL |st| "shade") (EQUAL |st| "render"))
              (QSETVELT (QVELT |v| 7) 1 3))
             ((OR (EQUAL |st| "solid") (EQUAL |st| "opaque"))
              (QSETVELT (QVELT |v| 7) 1 7))
             ((EQUAL |st| "contour") (QSETVELT (QVELT |v| 7) 1 24))
             ((EQUAL |st| "smooth") (QSETVELT (QVELT |v| 7) 1 22))
             ('T (QSETVELT (QVELT |v| 7) 1 9)))
           (EXIT (QSETVELT |v| 5
                     (SPADCALL (QVELT |v| 12)
                         (VECTOR (SPADCALL (QREFELT $ 20)
                                     (QREFELT $ 36))
                                 (SPADCALL (QREFELT $ 22)
                                     (QREFELT $ 36))
                                 (SPADCALL (QREFELT $ 23)
                                     (QREFELT $ 36))
                                 1.0 1.0 1.0
                                 (SPADCALL (QREFELT $ 24)
                                     (QREFELT $ 36))
                                 (SPADCALL (QREFELT $ 25)
                                     (QREFELT $ 36)))
                         (QREFELT $ 38)))))))) 

(DEFUN |VIEW3D;viewport3D;$;5| ($)
  (VECTOR 0 1 "FriCAS3D"
          (CONS (SPADCALL (SPADCALL (QREFELT $ 41)) 1 (QREFELT $ 43))
                (SPADCALL (SPADCALL (QREFELT $ 41)) 2 (QREFELT $ 43)))
          (CONS (SPADCALL (SPADCALL (QREFELT $ 45)) 1 (QREFELT $ 46))
                (SPADCALL (SPADCALL (QREFELT $ 45)) 2 (QREFELT $ 46)))
          (VECTOR (SPADCALL (QREFELT $ 20) (QREFELT $ 36))
                  (SPADCALL (QREFELT $ 22) (QREFELT $ 36))
                  (SPADCALL (QREFELT $ 23) (QREFELT $ 36)) 1.0 1.0 1.0
                  (SPADCALL (QREFELT $ 24) (QREFELT $ 36))
                  (SPADCALL (QREFELT $ 25) (QREFELT $ 36)))
          (CONS 0 27) (VECTOR 0 9 1 0 0 0)
          (VECTOR 0.0 0.0 1.0 0.0 0.0 1.0)
          (VECTOR 1 (FLOAT 500 MOST-POSITIVE-DOUBLE-FLOAT)
                  (FLOAT -250 MOST-POSITIVE-DOUBLE-FLOAT))
          (VECTOR 0.0 1.0 0.0 1.0 0.0 1.0 0 1)
          (SPADCALL (QREFELT $ 48)) NIL)) 

(PUT '|VIEW3D;subspace;$Ts;6| '|SPADreplace|
     '(XLAM (|viewport|) (QVELT |viewport| 11))) 

(DEFUN |VIEW3D;subspace;$Ts;6| (|viewport| $) (QVELT |viewport| 11)) 

(DEFUN |VIEW3D;subspace;$Ts$;7| (|viewport| |space| $)
  (SEQ (QSETVELT |viewport| 11 |space|) (EXIT |viewport|))) 

(PUT '|VIEW3D;options;$L;8| '|SPADreplace|
     '(XLAM (|viewport|) (QVELT |viewport| 12))) 

(DEFUN |VIEW3D;options;$L;8| (|viewport| $) (QVELT |viewport| 12)) 

(DEFUN |VIEW3D;options;$L$;9| (|viewport| |opts| $)
  (SEQ (QSETVELT |viewport| 12 |opts|) (EXIT |viewport|))) 

(DEFUN |VIEW3D;makeViewport3D;TsS$;10| (|space| |Title| $)
  (PROG (|v|)
    (RETURN
      (SEQ (LETT |v| (SPADCALL (QREFELT $ 49))
                 |VIEW3D;makeViewport3D;TsS$;10|)
           (QSETVELT |v| 11 |space|)
           (QSETVELT |v| 12 (LIST (SPADCALL |Title| (QREFELT $ 55))))
           (EXIT (SPADCALL |v| (QREFELT $ 56))))))) 

(DEFUN |VIEW3D;makeViewport3D;TsL$;11| (|space| |opts| $)
  (PROG (|v|)
    (RETURN
      (SEQ (LETT |v| (SPADCALL (QREFELT $ 49))
                 |VIEW3D;makeViewport3D;TsL$;11|)
           (QSETVELT |v| 11 |space|) (QSETVELT |v| 12 |opts|)
           (EXIT (SPADCALL |v| (QREFELT $ 56))))))) 

(DEFUN |VIEW3D;makeViewport3D;2$;12| (|viewport| $)
  (PROG (|transform| |lpts| |lllipts| |llprops| |lprops| |s| #0=#:G1936
            |n| |pt| #1=#:G1937 |aPoint| |onelprops| #2=#:G1940
            |oneprop| #3=#:G1939 |allipts| #4=#:G1938 |tinyprop|
            #5=#:G1942 |alipts| #6=#:G1941 |oneIndexedPoint|
            #7=#:G1943)
    (RETURN
      (SEQ (|VIEW3D;doOptions| |viewport| $)
           (|sayBrightly| (LIST "   Transmitting data..."))
           (LETT |transform|
                 (SPADCALL (QVELT |viewport| 12) (ELT $ 61)
                     (QREFELT $ 63))
                 . #8=(|VIEW3D;makeViewport3D;2$;12|))
           (SPADCALL (QVELT |viewport| 11) (QREFELT $ 64))
           (LETT |lpts|
                 (SPADCALL (QVELT |viewport| 11) (QREFELT $ 66)) . #8#)
           (LETT |lllipts|
                 (SPADCALL (QVELT |viewport| 11) (QREFELT $ 68)) . #8#)
           (LETT |llprops|
                 (SPADCALL (QVELT |viewport| 11) (QREFELT $ 70)) . #8#)
           (LETT |lprops|
                 (SPADCALL (QVELT |viewport| 11) (QREFELT $ 72)) . #8#)
           (LETT |s| (SPADCALL (QREFELT $ 74)) . #8#)
           (SEQ (LETT |pt| NIL . #8#) (LETT #0# |lpts| . #8#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |pt| (CAR #0#) . #8#) NIL))
                   #9=(GO G191)))
                (SEQ (EXIT (SPADCALL (SPADCALL |pt| (QREFELT $ 75)) |s|
                               (QREFELT $ 76))))
                (LETT #0# (CDR #0#) . #8#) #10=(GO G190) G191
                (EXIT NIL))
           (EXIT (COND
                   ((< 1 (SPADCALL |s| (QREFELT $ 77)))
                    (|error| "All points should have the same dimension"))
                   ('T
                    (SEQ (LETT |n|
                               (|SPADfirst|
                                   (SPADCALL |s| (QREFELT $ 78))) . #8#)
                         (EXIT (COND
                                 ((< |n| 3)
                                  (|error| "Dimension of points should be greater than 2"))
                                 ('T
                                  (SEQ (|sockSendInt| |$ViewportServer|
                                        (QVELT |viewport| 1))
                                       (|sockSendInt| |$ViewportServer|
                                        -1)
                                       (|sockSendString|
                                        |$ViewportServer|
                                        (QVELT |viewport| 2))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 5) 6))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 5) 7))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 5) 2))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 5) 3))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 5) 4))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 5) 5))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 5) 0))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 5) 1))
                                       (|sockSendInt| |$ViewportServer|
                                        (QCAR (QVELT |viewport| 3)))
                                       (|sockSendInt| |$ViewportServer|
                                        (QCDR (QVELT |viewport| 3)))
                                       (|sockSendInt| |$ViewportServer|
                                        (QCAR (QVELT |viewport| 4)))
                                       (|sockSendInt| |$ViewportServer|
                                        (QCDR (QVELT |viewport| 4)))
                                       (|sockSendInt| |$ViewportServer|
                                        (QVELT (QVELT |viewport| 7) 0))
                                       (|sockSendInt| |$ViewportServer|
                                        (QVELT (QVELT |viewport| 7) 1))
                                       (|sockSendInt| |$ViewportServer|
                                        (QVELT (QVELT |viewport| 7) 2))
                                       (|sockSendInt| |$ViewportServer|
                                        (QVELT (QVELT |viewport| 7) 3))
                                       (|sockSendInt| |$ViewportServer|
                                        (QVELT (QVELT |viewport| 7) 4))
                                       (|sockSendInt| |$ViewportServer|
                                        (QVELT (QVELT |viewport| 7) 5))
                                       (|sockSendInt| |$ViewportServer|
                                        (QVELT (QVELT |viewport| 10) 6))
                                       (|sockSendInt| |$ViewportServer|
                                        (QVELT (QVELT |viewport| 10) 7))
                                       (|sockSendInt| |$ViewportServer|
                                        (QCAR (QVELT |viewport| 6)))
                                       (|sockSendInt| |$ViewportServer|
                                        (QCDR (QVELT |viewport| 6)))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 8) 0))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 8) 1))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 8) 2))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 8) 5))
                                       (|sockSendInt| |$ViewportServer|
                                        (QVELT (QVELT |viewport| 9) 0))
                                       (|sockSendFloat|
                                        |$ViewportServer|
                                        (QVELT (QVELT |viewport| 9) 1))
                                       (|sockSendInt| |$ViewportServer|
                                        (LENGTH |lpts|))
                                       (SEQ (LETT |pt| NIL . #8#)
                                        (LETT #1# |lpts| . #8#) G190
                                        (COND
                                          ((OR (ATOM #1#)
                                            (PROGN
                                              (LETT |pt|
                                               (CAR #1#) . #8#)
                                              NIL))
                                           #9#))
                                        (SEQ
                                         (LETT |aPoint|
                                          (SPADCALL |pt| |transform|) . #8#)
                                         (|sockSendFloat|
                                          |$ViewportServer|
                                          (SPADCALL |aPoint|
                                           (QREFELT $ 81)))
                                         (|sockSendFloat|
                                          |$ViewportServer|
                                          (SPADCALL |aPoint|
                                           (QREFELT $ 82)))
                                         (|sockSendFloat|
                                          |$ViewportServer|
                                          (SPADCALL |aPoint|
                                           (QREFELT $ 83)))
                                         (EXIT
                                          (COND
                                            ((EQL |n| 3)
                                             (|sockSendFloat|
                                              |$ViewportServer|
                                              (SPADCALL |aPoint|
                                               (QREFELT $ 83))))
                                            ('T
                                             (|sockSendFloat|
                                              |$ViewportServer|
                                              (SPADCALL |aPoint|
                                               (QREFELT $ 84)))))))
                                        (LETT #1# (CDR #1#) . #8#) #10#
                                        G191 (EXIT NIL))
                                       (|sockSendInt| |$ViewportServer|
                                        (LENGTH |lllipts|))
                                       (SEQ
                                        (LETT |onelprops| NIL . #8#)
                                        (LETT #2# |llprops| . #8#)
                                        (LETT |oneprop| NIL . #8#)
                                        (LETT #3# |lprops| . #8#)
                                        (LETT |allipts| NIL . #8#)
                                        (LETT #4# |lllipts| . #8#) G190
                                        (COND
                                          ((OR (ATOM #4#)
                                            (PROGN
                                              (LETT |allipts|
                                               (CAR #4#) . #8#)
                                              NIL)
                                            (ATOM #3#)
                                            (PROGN
                                              (LETT |oneprop|
                                               (CAR #3#) . #8#)
                                              NIL)
                                            (ATOM #2#)
                                            (PROGN
                                              (LETT |onelprops|
                                               (CAR #2#) . #8#)
                                              NIL))
                                           #9#))
                                        (SEQ
                                         (|sockSendInt|
                                          |$ViewportServer|
                                          (COND
                                            ((SPADCALL |oneprop|
                                              (QREFELT $ 87))
                                             1)
                                            ('T 0)))
                                         (|sockSendInt|
                                          |$ViewportServer|
                                          (COND
                                            ((SPADCALL |oneprop|
                                              (QREFELT $ 88))
                                             1)
                                            ('T 0)))
                                         (|sockSendInt|
                                          |$ViewportServer|
                                          (LENGTH |allipts|))
                                         (EXIT
                                          (SEQ
                                           (LETT |tinyprop| NIL . #8#)
                                           (LETT #5# |onelprops| . #8#)
                                           (LETT |alipts| NIL . #8#)
                                           (LETT #6# |allipts| . #8#)
                                           G190
                                           (COND
                                             ((OR (ATOM #6#)
                                               (PROGN
                                                 (LETT |alipts|
                                                  (CAR #6#) . #8#)
                                                 NIL)
                                               (ATOM #5#)
                                               (PROGN
                                                 (LETT |tinyprop|
                                                  (CAR #5#) . #8#)
                                                 NIL))
                                              #9#))
                                           (SEQ
                                            (|sockSendInt|
                                             |$ViewportServer|
                                             (COND
                                               ((SPADCALL |tinyprop|
                                                 (QREFELT $ 87))
                                                1)
                                               ('T 0)))
                                            (|sockSendInt|
                                             |$ViewportServer|
                                             (COND
                                               ((SPADCALL |tinyprop|
                                                 (QREFELT $ 88))
                                                1)
                                               ('T 0)))
                                            (|sockSendInt|
                                             |$ViewportServer|
                                             (SPADCALL |alipts|
                                              (QREFELT $ 89)))
                                            (EXIT
                                             (SEQ
                                              (LETT |oneIndexedPoint|
                                               NIL . #8#)
                                              (LETT #7# |alipts| . #8#)
                                              G190
                                              (COND
                                                ((OR (ATOM #7#)
                                                  (PROGN
                                                    (LETT
                                                     |oneIndexedPoint|
                                                     (CAR #7#) . #8#)
                                                    NIL))
                                                 #9#))
                                              (SEQ
                                               (EXIT
                                                (|sockSendInt|
                                                 |$ViewportServer|
                                                 |oneIndexedPoint|)))
                                              (LETT #7#
                                               (CDR #7#) . #8#)
                                              #10# G191 (EXIT NIL))))
                                           (LETT #6#
                                            (PROG1 (CDR #6#)
                                              (LETT #5#
                                               (CDR #5#) . #8#)) . #8#)
                                           #10# G191 (EXIT NIL))))
                                        (LETT #4#
                                         (PROG1 (CDR #4#)
                                           (LETT #3#
                                            (PROG1 (CDR #3#)
                                              (LETT #2#
                                               (CDR #2#) . #8#)) . #8#)) . #8#)
                                        #10# G191 (EXIT NIL))
                                       (QSETVELT |viewport| 0
                                        (|sockGetInt|
                                         |$ViewportServer|))
                                       (EXIT |viewport|))))))))))))) 

(DEFUN |VIEW3D;viewThetaDefault;F;13| ($)
  (SPADCALL (SPADCALL (QREFELT $ 20) (QREFELT $ 90)) (QREFELT $ 28))) 

(DEFUN |VIEW3D;viewThetaDefault;2F;14| (|t| $)
  (SEQ (SPADCALL (QREFELT $ 20) (SPADCALL |t| (QREFELT $ 17))
           (QREFELT $ 92))
       (EXIT |t|))) 

(DEFUN |VIEW3D;viewPhiDefault;F;15| ($)
  (SPADCALL (SPADCALL (QREFELT $ 22) (QREFELT $ 90)) (QREFELT $ 28))) 

(DEFUN |VIEW3D;viewPhiDefault;2F;16| (|t| $)
  (SEQ (SPADCALL (QREFELT $ 22) (SPADCALL |t| (QREFELT $ 17))
           (QREFELT $ 92))
       (EXIT |t|))) 

(DEFUN |VIEW3D;viewZoomDefault;F;17| ($)
  (SPADCALL (SPADCALL (QREFELT $ 23) (QREFELT $ 90)) (QREFELT $ 28))) 

(DEFUN |VIEW3D;viewZoomDefault;2F;18| (|t| $)
  (SEQ (SPADCALL (QREFELT $ 23) (SPADCALL |t| (QREFELT $ 17))
           (QREFELT $ 92))
       (EXIT |t|))) 

(DEFUN |VIEW3D;viewDeltaXDefault;F;19| ($)
  (SPADCALL (SPADCALL (QREFELT $ 24) (QREFELT $ 90)) (QREFELT $ 28))) 

(DEFUN |VIEW3D;viewDeltaXDefault;2F;20| (|t| $)
  (SEQ (SPADCALL (QREFELT $ 24) (SPADCALL |t| (QREFELT $ 17))
           (QREFELT $ 92))
       (EXIT |t|))) 

(DEFUN |VIEW3D;viewDeltaYDefault;F;21| ($)
  (SPADCALL (SPADCALL (QREFELT $ 25) (QREFELT $ 90)) (QREFELT $ 28))) 

(DEFUN |VIEW3D;viewDeltaYDefault;2F;22| (|t| $)
  (SEQ (SPADCALL (QREFELT $ 25) (SPADCALL |t| (QREFELT $ 17))
           (QREFELT $ 92))
       (EXIT |t|))) 

(DEFUN |VIEW3D;lighting;$3FV;23|
       (|viewport| |Xlight| |Ylight| |Zlight| $)
  (PROG (#0=#:G1962 #1=#:G1963)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT (QVELT |viewport| 8) 0
                          (SPADCALL |Xlight| (QREFELT $ 17)))
                      (QSETVELT (QVELT |viewport| 8) 1
                          (SPADCALL |Ylight| (QREFELT $ 17)))
                      (QSETVELT (QVELT |viewport| 8) 2
                          (SPADCALL |Zlight| (QREFELT $ 17)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 108)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     8)
                                                    0))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     8)
                                                    1))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     8)
                                                    2))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;lighting;$3FV;23|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;axes;$SV;24| (|viewport| |onOff| $)
  (PROG (#0=#:G1968 #1=#:G1969)
    (RETURN
      (SEQ (EXIT (SEQ (COND
                        ((EQUAL |onOff| "on")
                         (QSETVELT (QVELT |viewport| 7) 2 1))
                        ('T (QSETVELT (QVELT |viewport| 7) 2 0)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 6)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     7)
                                                    2))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;axes;$SV;24|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;diagonals;$SV;25| (|viewport| |onOff| $)
  (PROG (#0=#:G1974 #1=#:G1975)
    (RETURN
      (SEQ (EXIT (SEQ (COND
                        ((EQUAL |onOff| "on")
                         (QSETVELT (QVELT |viewport| 7) 3 1))
                        ('T (QSETVELT (QVELT |viewport| 7) 3 0)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 26)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     7)
                                                    3))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;diagonals;$SV;25|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;outlineRender;$SV;26| (|viewport| |onOff| $)
  (PROG (#0=#:G1980 #1=#:G1981)
    (RETURN
      (SEQ (EXIT (SEQ (COND
                        ((EQUAL |onOff| "on")
                         (QSETVELT (QVELT |viewport| 7) 4 1))
                        ('T (QSETVELT (QVELT |viewport| 7) 4 0)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 13)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     7)
                                                    4))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;outlineRender;$SV;26|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;controlPanel;$SV;27| (|viewport| |onOff| $)
  (PROG (#0=#:G1986 #1=#:G1987)
    (RETURN
      (SEQ (EXIT (SEQ (COND
                        ((EQUAL |onOff| "on")
                         (QSETVELT (QVELT |viewport| 7) 0 1))
                        ('T (QSETVELT (QVELT |viewport| 7) 0 0)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 4)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     7)
                                                    0))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;controlPanel;$SV;27|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;drawStyle;$SV;28| (|viewport| |how| $)
  (PROG (#0=#:G1991 #1=#:G1992)
    (RETURN
      (SEQ (EXIT (SEQ (COND
                        ((EQUAL |how| "shade")
                         (QSETVELT (QVELT |viewport| 7) 1 3))
                        ((EQUAL |how| "solid")
                         (QSETVELT (QVELT |viewport| 7) 1 7))
                        ((EQUAL |how| "contour")
                         (QSETVELT (QVELT |viewport| 7) 1 24))
                        ((EQUAL |how| "smooth")
                         (QSETVELT (QVELT |viewport| 7) 1 22))
                        ('T (QSETVELT (QVELT |viewport| 7) 1 9)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer|
                                           (QVELT (QVELT |viewport| 7)
                                            1))
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (|sockGetInt|
                                                  |$ViewportServer|)
                                                 . #2=(|VIEW3D;drawStyle;$SV;28|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;reset;$V;29| (|viewport| $)
  (PROG (#0=#:G1996 #1=#:G1997)
    (RETURN
      (SEQ (EXIT (COND
                   ((NULL (EQL (SPADCALL |viewport| (QREFELT $ 102)) 0))
                    (PROGN
                      (LETT #1#
                            (SEQ (EXIT (SEQ
                                        (|sockSendInt|
                                         |$ViewportServer| 1)
                                        (|sockSendInt|
                                         |$ViewportServer| 100)
                                        (EXIT
                                         (COND
                                           ((|VIEW3D;checkViewport|
                                             |viewport| $)
                                            (PROGN
                                              (LETT #0#
                                               (SEQ
                                                (|sockSendInt|
                                                 |$ViewportServer| 8)
                                                (EXIT
                                                 (|sockGetInt|
                                                  |$ViewportServer|)))
                                               . #2=(|VIEW3D;reset;$V;29|))
                                              (GO #0#)))))))
                                 #0# (EXIT #0#)) . #2#)
                      (GO #1#)))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;close;$V;30| (|viewport| $)
  (PROG (#0=#:G2001 #1=#:G2002)
    (RETURN
      (SEQ (EXIT (COND
                   ((NULL (EQL (SPADCALL |viewport| (QREFELT $ 102)) 0))
                    (PROGN
                      (LETT #1#
                            (SEQ (EXIT (SEQ
                                        (|sockSendInt|
                                         |$ViewportServer| 1)
                                        (|sockSendInt|
                                         |$ViewportServer| 5)
                                        (EXIT
                                         (COND
                                           ((|VIEW3D;checkViewport|
                                             |viewport| $)
                                            (PROGN
                                              (LETT #0#
                                               (SEQ
                                                (|sockGetInt|
                                                 |$ViewportServer|)
                                                (EXIT
                                                 (QSETVELT |viewport| 0
                                                  0)))
                                               . #2=(|VIEW3D;close;$V;30|))
                                              (GO #0#)))))))
                                 #0# (EXIT #0#)) . #2#)
                      (GO #1#)))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;viewpoint;$R;31| (|viewport| $)
  (PROG (|deltaXsf| |deltaYsf| |scalesf| |scaleXsf| |scaleYsf|
            |scaleZsf| |thetasf| |phisf| #0=#:G2008)
    (RETURN
      (SEQ (EXIT (COND
                   ((NULL (EQL (SPADCALL |viewport| (QREFELT $ 102)) 0))
                    (PROGN
                      (LETT #0#
                            (SEQ (|sockSendInt| |$ViewportServer| 1)
                                 (|sockSendInt| |$ViewportServer| 117)
                                 (EXIT (COND
                                         ((|VIEW3D;checkViewport|
                                           |viewport| $)
                                          (SEQ
                                           (LETT |deltaXsf|
                                            (|sockGetFloat|
                                             |$ViewportServer|)
                                            . #1=(|VIEW3D;viewpoint;$R;31|))
                                           (LETT |deltaYsf|
                                            (|sockGetFloat|
                                             |$ViewportServer|) . #1#)
                                           (LETT |scalesf|
                                            (|sockGetFloat|
                                             |$ViewportServer|) . #1#)
                                           (LETT |scaleXsf|
                                            (|sockGetFloat|
                                             |$ViewportServer|) . #1#)
                                           (LETT |scaleYsf|
                                            (|sockGetFloat|
                                             |$ViewportServer|) . #1#)
                                           (LETT |scaleZsf|
                                            (|sockGetFloat|
                                             |$ViewportServer|) . #1#)
                                           (LETT |thetasf|
                                            (|sockGetFloat|
                                             |$ViewportServer|) . #1#)
                                           (LETT |phisf|
                                            (|sockGetFloat|
                                             |$ViewportServer|) . #1#)
                                           (|sockGetInt|
                                            |$ViewportServer|)
                                           (EXIT
                                            (QSETVELT |viewport| 5
                                             (VECTOR |thetasf| |phisf|
                                              |scalesf| |scaleXsf|
                                              |scaleYsf| |scaleZsf|
                                              |deltaXsf| |deltaYsf|)))))
                                         ('T (QVELT |viewport| 5))))) . #1#)
                      (GO #0#)))))
           #0# (EXIT #0#))))) 

(DEFUN |VIEW3D;viewpoint;$RV;32| (|viewport| |viewpt| $)
  (PROG (#0=#:G2013 #1=#:G2014)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT |viewport| 5 |viewpt|)
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 118)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    6))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    7))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    2))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    3))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    4))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    5))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    0))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    1))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;viewpoint;$RV;32|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;viewpoint;$5FV;33|
       (|viewport| |Theta| |Phi| |Scale| |DeltaX| |DeltaY| $)
  (QSETVELT |viewport| 5
      (VECTOR (SPADCALL |Theta| (QREFELT $ 17))
              (SPADCALL |Phi| (QREFELT $ 17))
              (SPADCALL |Scale| (QREFELT $ 17)) 1.0 1.0 1.0
              (SPADCALL |DeltaX| (QREFELT $ 17))
              (SPADCALL |DeltaY| (QREFELT $ 17))))) 

(DEFUN |VIEW3D;viewpoint;$2I3FV;34|
       (|viewport| |Theta| |Phi| |Scale| |DeltaX| |DeltaY| $)
  (QSETVELT |viewport| 5
      (VECTOR (* (FLOAT |Theta| MOST-POSITIVE-DOUBLE-FLOAT)
                 (QREFELT $ 15))
              (* (FLOAT |Phi| MOST-POSITIVE-DOUBLE-FLOAT)
                 (QREFELT $ 15))
              (SPADCALL |Scale| (QREFELT $ 17)) 1.0 1.0 1.0
              (SPADCALL |DeltaX| (QREFELT $ 17))
              (SPADCALL |DeltaY| (QREFELT $ 17))))) 

(DEFUN |VIEW3D;viewpoint;$2FV;35| (|viewport| |Theta| |Phi| $)
  (SEQ (QSETVELT (QVELT |viewport| 5) 0
           (* (SPADCALL |Theta| (QREFELT $ 17)) (QREFELT $ 15)))
       (EXIT (QSETVELT (QVELT |viewport| 5) 1
                 (* (SPADCALL |Phi| (QREFELT $ 17)) (QREFELT $ 15)))))) 

(DEFUN |VIEW3D;viewpoint;$3FV;36| (|viewport| X Y Z $)
  (PROG (R |Theta| |Phi|)
    (RETURN
      (SEQ (COND
             ((SPADCALL X (|spadConstant| $ 9) (QREFELT $ 117))
              (COND
                ((SPADCALL Y (|spadConstant| $ 9) (QREFELT $ 117))
                 (SEQ (LETT |Theta| (|spadConstant| $ 9)
                            . #0=(|VIEW3D;viewpoint;$3FV;36|))
                      (EXIT (COND
                              ((SPADCALL Z (|spadConstant| $ 9)
                                   (QREFELT $ 118))
                               (LETT |Phi|
                                     (SPADCALL 180 0 10 (QREFELT $ 12)) . #0#))
                              (#1='T
                               (LETT |Phi| (|spadConstant| $ 9) . #0#))))))
                (#1#
                 (SEQ (LETT |Theta|
                            (SPADCALL
                                (SPADCALL Y
                                    (LETT R
                                     (SPADCALL
                                      (SPADCALL
                                       (SPADCALL X X (QREFELT $ 119))
                                       (SPADCALL Y Y (QREFELT $ 119))
                                       (QREFELT $ 120))
                                      (QREFELT $ 121)) . #0#)
                                    (QREFELT $ 13))
                                (QREFELT $ 29)) . #0#)
                      (EXIT (COND
                              ((SPADCALL Z (|spadConstant| $ 9)
                                   (QREFELT $ 117))
                               (LETT |Phi|
                                     (SPADCALL 90 0 10 (QREFELT $ 12)) . #0#))
                              (#1#
                               (LETT |Phi|
                                     (SPADCALL
                                      (SPADCALL Z R (QREFELT $ 13))
                                      (QREFELT $ 30)) . #0#))))))))
             (#1#
              (SEQ (LETT |Theta|
                         (SPADCALL
                             (SPADCALL Y
                                 (LETT R
                                       (SPADCALL
                                        (SPADCALL
                                         (SPADCALL X X (QREFELT $ 119))
                                         (SPADCALL Y Y (QREFELT $ 119))
                                         (QREFELT $ 120))
                                        (QREFELT $ 121)) . #0#)
                                 (QREFELT $ 13))
                             (QREFELT $ 29)) . #0#)
                   (EXIT (COND
                           ((SPADCALL Z (|spadConstant| $ 9)
                                (QREFELT $ 117))
                            (LETT |Phi|
                                  (SPADCALL 90 0 10 (QREFELT $ 12)) . #0#))
                           (#1#
                            (LETT |Phi|
                                  (SPADCALL
                                      (SPADCALL Z R (QREFELT $ 13))
                                      (QREFELT $ 30)) . #0#)))))))
           (EXIT (SPADCALL |viewport|
                     (SPADCALL |Theta| (QREFELT $ 14) (QREFELT $ 119))
                     (SPADCALL |Phi| (QREFELT $ 14) (QREFELT $ 119))
                     (QREFELT $ 122))))))) 

(DEFUN |VIEW3D;title;$SV;37| (|viewport| |Title| $)
  (PROG (#0=#:G2030 #1=#:G2031)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT |viewport| 2 |Title|)
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 104)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendString|
                                                   |$ViewportServer|
                                                   |Title|)
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;title;$SV;37|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;colorDef;$2CV;38| (|viewport| |HueOffset| |HueNumber| $)
  (PROG (|h| #0=#:G2036 #1=#:G2037)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT |viewport| 6
                          (CONS (LETT |h|
                                      (SPADCALL |HueOffset|
                                       (QREFELT $ 126))
                                      . #2=(|VIEW3D;colorDef;$2CV;38|))
                                (- (SPADCALL |HueNumber|
                                    (QREFELT $ 126))
                                   |h|)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 101)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   (SPADCALL
                                                    |HueOffset|
                                                    (QREFELT $ 126)))
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   (SPADCALL
                                                    |HueNumber|
                                                    (QREFELT $ 126)))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|))) . #2#)
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;dimensions;$2Nni2PiV;39|
       (|viewport| |ViewX| |ViewY| |ViewWidth| |ViewHeight| $)
  (SEQ (QSETVELT |viewport| 3 (CONS |ViewX| |ViewY|))
       (EXIT (QSETVELT |viewport| 4 (CONS |ViewWidth| |ViewHeight|))))) 

(DEFUN |VIEW3D;move;$2NniV;40| (|viewport| |xLoc| |yLoc| $)
  (PROG (#0=#:G2046 #1=#:G2047)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT |viewport| 3 (CONS |xLoc| |yLoc|))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 102)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   |xLoc|)
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   |yLoc|)
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;move;$2NniV;40|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;resize;$2PiV;41| (|viewport| |xSize| |ySize| $)
  (PROG (#0=#:G2052 #1=#:G2053)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT |viewport| 4 (CONS |xSize| |ySize|))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 103)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   |xSize|)
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   |ySize|)
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;resize;$2PiV;41|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;coerce;$Of;42| (|viewport| $)
  (COND
    ((EQL (SPADCALL |viewport| (QREFELT $ 102)) 0)
     (SPADCALL
         (LIST "Closed or Undefined ThreeDimensionalViewport: "
               (SPADCALL (QVELT |viewport| 2) (QREFELT $ 132)))
         (QREFELT $ 134)))
    ('T
     (SPADCALL
         (LIST "ThreeDimensionalViewport: "
               (SPADCALL (QVELT |viewport| 2) (QREFELT $ 132)))
         (QREFELT $ 134))))) 

(PUT '|VIEW3D;key;$I;43| '|SPADreplace|
     '(XLAM (|viewport|) (QVELT |viewport| 0))) 

(DEFUN |VIEW3D;key;$I;43| (|viewport| $) (QVELT |viewport| 0)) 

(DEFUN |VIEW3D;rotate;$2IV;44| (|viewport| |Theta| |Phi| $)
  (SPADCALL |viewport|
      (SPADCALL (SPADCALL |Theta| (QREFELT $ 136)) (QREFELT $ 14)
          (QREFELT $ 119))
      (SPADCALL (SPADCALL |Phi| (QREFELT $ 136)) (QREFELT $ 14)
          (QREFELT $ 119))
      (QREFELT $ 122))) 

(DEFUN |VIEW3D;rotate;$2FV;45| (|viewport| |Theta| |Phi| $)
  (PROG (#0=#:G2063 #1=#:G2064)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT (QVELT |viewport| 5) 0
                          (SPADCALL |Theta| (QREFELT $ 17)))
                      (QSETVELT (QVELT |viewport| 5) 1
                          (SPADCALL |Phi| (QREFELT $ 17)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 0)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    0))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    1))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;rotate;$2FV;45|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;zoom;$FV;46| (|viewport| |Scale| $)
  (PROG (#0=#:G2069 #1=#:G2070)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT (QVELT |viewport| 5) 2
                          (SPADCALL |Scale| (QREFELT $ 17)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    2))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;zoom;$FV;46|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;zoom;$3FV;47| (|viewport| |ScaleX| |ScaleY| |ScaleZ| $)
  (PROG (#0=#:G2075 #1=#:G2076)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT (QVELT |viewport| 5) 3
                          (SPADCALL |ScaleX| (QREFELT $ 17)))
                      (QSETVELT (QVELT |viewport| 5) 4
                          (SPADCALL |ScaleY| (QREFELT $ 17)))
                      (QSETVELT (QVELT |viewport| 5) 5
                          (SPADCALL |ScaleZ| (QREFELT $ 17)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 14)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    3))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    4))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    5))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;zoom;$3FV;47|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;translate;$2FV;48| (|viewport| |DeltaX| |DeltaY| $)
  (PROG (#0=#:G2081 #1=#:G2082)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT (QVELT |viewport| 5) 6
                          (SPADCALL |DeltaX| (QREFELT $ 17)))
                      (QSETVELT (QVELT |viewport| 5) 7
                          (SPADCALL |DeltaY| (QREFELT $ 17)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 2)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    6))
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     5)
                                                    7))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;translate;$2FV;48|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;intensity;$FV;49| (|viewport| |Amount| $)
  (PROG (#0=#:G2087 #1=#:G2088)
    (RETURN
      (SEQ (EXIT (SEQ (COND
                        ((OR (SPADCALL |Amount| (|spadConstant| $ 9)
                                 (QREFELT $ 118))
                             (SPADCALL (|spadConstant| $ 26) |Amount|
                                 (QREFELT $ 118)))
                         (|error| "The intensity must be a value between 0 and 1, inclusively.")))
                      (QSETVELT (QVELT |viewport| 8) 5
                          (SPADCALL |Amount| (QREFELT $ 17)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 109)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     8)
                                                    5))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;intensity;$FV;49|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;write;$3S;50| (|viewport| |Filename| |aThingToWrite| $)
  (SPADCALL |viewport| |Filename| (LIST |aThingToWrite|)
      (QREFELT $ 143))) 

(DEFUN |VIEW3D;write;$2S;51| (|viewport| |Filename| $)
  (SPADCALL |viewport| |Filename| (SPADCALL (QREFELT $ 145))
      (QREFELT $ 143))) 

(DEFUN |VIEW3D;write;$SLS;52| (|viewport| |Filename| |thingsToWrite| $)
  (PROG (|stringToSend| |avail| |m| |aTypeOfFile| #0=#:G2099
            |writeTypeInt| #1=#:G2096 #2=#:G2097)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |stringToSend| ""
                            . #3=(|VIEW3D;write;$SLS;52|))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #2#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 110)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #1#
                                                 (SEQ
                                                  (|sockSendString|
                                                   |$ViewportServer|
                                                   |Filename|)
                                                  (LETT |m|
                                                   (SPADCALL
                                                    (LETT |avail|
                                                     (SPADCALL
                                                      (QREFELT $ 147)) . #3#)
                                                    (QREFELT $ 148)) . #3#)
                                                  (SEQ
                                                   (LETT |aTypeOfFile|
                                                    NIL . #3#)
                                                   (LETT #0#
                                                    |thingsToWrite| . #3#)
                                                   G190
                                                   (COND
                                                     ((OR (ATOM #0#)
                                                       (PROGN
                                                         (LETT
                                                          |aTypeOfFile|
                                                          (CAR #0#) . #3#)
                                                         NIL))
                                                      (GO G191)))
                                                   (SEQ
                                                    (LETT
                                                     |writeTypeInt|
                                                     (-
                                                      (SPADCALL
                                                       (SPADCALL
                                                        |aTypeOfFile|
                                                        (QREFELT $ 149))
                                                       |avail|
                                                       (QREFELT $ 150))
                                                      |m|) . #3#)
                                                    (EXIT
                                                     (COND
                                                       ((<
                                                         |writeTypeInt|
                                                         0)
                                                        (|sayBrightly|
                                                         (LIST "  > "
                                                          (SPADCALL
                                                           (STRCONC
                                                            |aTypeOfFile|
                                                            " is not a valid file type for writing a 3D viewport")
                                                           (QREFELT $
                                                            132)))))
                                                       ('T
                                                        (|sockSendInt|
                                                         |$ViewportServer|
                                                         (+
                                                          |writeTypeInt|
                                                          1))))))
                                                   (LETT #0#
                                                    (CDR #0#) . #3#)
                                                   (GO G190) G191
                                                   (EXIT NIL))
                                                  (|sockSendInt|
                                                   |$ViewportServer| 0)
                                                  (|sockGetInt|
                                                   |$ViewportServer|)
                                                  (EXIT |Filename|)) . #3#)
                                                (GO #1#)))))))
                                        #1# (EXIT #1#)) . #3#)
                                 (GO #2#)))))))
           #2# (EXIT #2#))))) 

(DEFUN |VIEW3D;perspective;$SV;53| (|viewport| |onOff| $)
  (PROG (#0=#:G2103 #1=#:G2104)
    (RETURN
      (SEQ (EXIT (SEQ (COND
                        ((EQUAL |onOff| "on")
                         (QSETVELT (QVELT |viewport| 9) 0 1))
                        ('T (QSETVELT (QVELT |viewport| 9) 0 0)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 27)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     9)
                                                    0))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;perspective;$SV;53|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;showRegion;$SV;54| (|viewport| |onOff| $)
  (PROG (#0=#:G2109 #1=#:G2110)
    (RETURN
      (SEQ (EXIT (SEQ (COND
                        ((EQUAL |onOff| "on")
                         (QSETVELT (QVELT |viewport| 7) 5 1))
                        ('T (QSETVELT (QVELT |viewport| 7) 5 0)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 12)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     7)
                                                    5))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;showRegion;$SV;54|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;showClipRegion;$SV;55| (|viewport| |onOff| $)
  (PROG (#0=#:G2115 #1=#:G2116)
    (RETURN
      (SEQ (EXIT (SEQ (COND
                        ((EQUAL |onOff| "on")
                         (QSETVELT (QVELT |viewport| 10) 6 1))
                        ('T (QSETVELT (QVELT |viewport| 10) 6 0)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 66)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     10)
                                                    6))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;showClipRegion;$SV;55|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;clipSurface;$SV;56| (|viewport| |onOff| $)
  (PROG (#0=#:G2121 #1=#:G2122)
    (RETURN
      (SEQ (EXIT (SEQ (COND
                        ((EQUAL |onOff| "on")
                         (QSETVELT (QVELT |viewport| 10) 7 1))
                        ('T (QSETVELT (QVELT |viewport| 10) 7 0)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 67)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendInt|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     10)
                                                    7))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;clipSurface;$SV;56|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;eyeDistance;$FV;57| (|viewport| |EyeDistance| $)
  (PROG (#0=#:G2127 #1=#:G2128)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT (QVELT |viewport| 9) 1
                          (SPADCALL |EyeDistance| (QREFELT $ 17)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 111)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     9)
                                                    1))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;eyeDistance;$FV;57|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;hitherPlane;$FV;58| (|viewport| |HitherPlane| $)
  (PROG (#0=#:G2133 #1=#:G2134)
    (RETURN
      (SEQ (EXIT (SEQ (QSETVELT (QVELT |viewport| 9) 2
                          (SPADCALL |HitherPlane| (QREFELT $ 17)))
                      (EXIT (COND
                              ((NULL (EQL
                                      (SPADCALL |viewport|
                                       (QREFELT $ 102))
                                      0))
                               (PROGN
                                 (LETT #1#
                                       (SEQ
                                        (EXIT
                                         (SEQ
                                          (|sockSendInt|
                                           |$ViewportServer| 1)
                                          (|sockSendInt|
                                           |$ViewportServer| 116)
                                          (EXIT
                                           (COND
                                             ((|VIEW3D;checkViewport|
                                               |viewport| $)
                                              (PROGN
                                                (LETT #0#
                                                 (SEQ
                                                  (|sockSendFloat|
                                                   |$ViewportServer|
                                                   (QVELT
                                                    (QVELT |viewport|
                                                     9)
                                                    2))
                                                  (EXIT
                                                   (|sockGetInt|
                                                    |$ViewportServer|)))
                                                 . #2=(|VIEW3D;hitherPlane;$FV;58|))
                                                (GO #0#)))))))
                                        #0# (EXIT #0#)) . #2#)
                                 (GO #1#)))))))
           #1# (EXIT #1#))))) 

(DEFUN |VIEW3D;modifyPointData;$NniPV;59|
       (|viewport| |anIndex| |aPoint| $)
  (PROG (|n| #0=#:G2138 #1=#:G2139)
    (RETURN
      (SEQ (LETT |n| (SPADCALL |aPoint| (QREFELT $ 75))
                 . #2=(|VIEW3D;modifyPointData;$NniPV;59|))
           (EXIT (COND
                   ((< |n| 3)
                    (|error| "The point should have dimension of at least 3"))
                   ('T
                    (SEQ (EXIT (SEQ (QSETVELT |viewport| 11
                                     (SPADCALL (QVELT |viewport| 11)
                                      |anIndex| |aPoint|
                                      (QREFELT $ 157)))
                                    (EXIT
                                     (COND
                                       ((NULL
                                         (EQL
                                          (SPADCALL |viewport|
                                           (QREFELT $ 102))
                                          0))
                                        (PROGN
                                          (LETT #1#
                                           (SEQ
                                            (EXIT
                                             (SEQ
                                              (|sockSendInt|
                                               |$ViewportServer| 1)
                                              (|sockSendInt|
                                               |$ViewportServer| 114)
                                              (EXIT
                                               (COND
                                                 ((|VIEW3D;checkViewport|
                                                   |viewport| $)
                                                  (PROGN
                                                    (LETT #0#
                                                     (SEQ
                                                      (|sockSendInt|
                                                       |$ViewportServer|
                                                       |anIndex|)
                                                      (|sockSendFloat|
                                                       |$ViewportServer|
                                                       (SPADCALL
                                                        |aPoint|
                                                        (QREFELT $ 81)))
                                                      (|sockSendFloat|
                                                       |$ViewportServer|
                                                       (SPADCALL
                                                        |aPoint|
                                                        (QREFELT $ 82)))
                                                      (|sockSendFloat|
                                                       |$ViewportServer|
                                                       (SPADCALL
                                                        |aPoint|
                                                        (QREFELT $ 83)))
                                                      (COND
                                                        ((EQL |n| 3)
                                                         (|sockSendFloat|
                                                          |$ViewportServer|
                                                          (SPADCALL
                                                           (SPADCALL 5
                                                            -1 10
                                                            (QREFELT $
                                                             12))
                                                           (QREFELT $
                                                            17))))
                                                        ('T
                                                         (|sockSendFloat|
                                                          |$ViewportServer|
                                                          (SPADCALL
                                                           |aPoint|
                                                           (QREFELT $
                                                            84)))))
                                                      (EXIT
                                                       (|sockGetInt|
                                                        |$ViewportServer|))) . #2#)
                                                    (GO #0#)))))))
                                            #0# (EXIT #0#)) . #2#)
                                          (GO #1#)))))))
                         #1# (EXIT #1#))))))))) 

(DEFUN |ThreeDimensionalViewport| ()
  (PROG ()
    (RETURN
      (PROG (#0=#:G2143)
        (RETURN
          (COND
            ((LETT #0#
                   (HGET |$ConstructorCache|
                         '|ThreeDimensionalViewport|)
                   . #1=(|ThreeDimensionalViewport|))
             (|CDRwithIncrement| (CDAR #0#)))
            ('T
             (UNWIND-PROTECT
               (PROG1 (CDDAR (HPUT |$ConstructorCache|
                                   '|ThreeDimensionalViewport|
                                   (LIST
                                    (CONS NIL
                                     (CONS 1
                                      (|ThreeDimensionalViewport;|))))))
                 (LETT #0# T . #1#))
               (COND
                 ((NOT #0#)
                  (HREM |$ConstructorCache|
                        '|ThreeDimensionalViewport|))))))))))) 

(DEFUN |ThreeDimensionalViewport;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|ThreeDimensionalViewport|)
              . #0=(|ThreeDimensionalViewport|))
        (LETT $ (GETREFV 160) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|ThreeDimensionalViewport| NIL
            (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6
            (|Record| (|:| |key| (|Integer|)) (|:| |fun| (|Integer|))
                (|:| |title| (|String|))
                (|:| |moveTo|
                     (|Record| (|:| X (|NonNegativeInteger|))
                         (|:| Y (|NonNegativeInteger|))))
                (|:| |size|
                     (|Record| (|:| X (|PositiveInteger|))
                         (|:| Y (|PositiveInteger|))))
                (|:| |viewpoint|
                     (|Record| (|:| |theta| (|DoubleFloat|))
                         (|:| |phi| (|DoubleFloat|))
                         (|:| |scale| (|DoubleFloat|))
                         (|:| |scaleX| (|DoubleFloat|))
                         (|:| |scaleY| (|DoubleFloat|))
                         (|:| |scaleZ| (|DoubleFloat|))
                         (|:| |deltaX| (|DoubleFloat|))
                         (|:| |deltaY| (|DoubleFloat|))))
                (|:| |colors|
                     (|Record| (|:| |hueOffset| (|Integer|))
                         (|:| |hueNumber| (|Integer|))))
                (|:| |flags|
                     (|Record| (|:| |showCP| (|Integer|))
                         (|:| |style| (|Integer|))
                         (|:| |axesOn| (|Integer|))
                         (|:| |diagonalsOn| (|Integer|))
                         (|:| |outlineRenderOn| (|Integer|))
                         (|:| |showRegionField| (|Integer|))))
                (|:| |lighting|
                     (|Record| (|:| |lightX| (|DoubleFloat|))
                         (|:| |lightY| (|DoubleFloat|))
                         (|:| |lightZ| (|DoubleFloat|))
                         (|:| |lightTheta| (|DoubleFloat|))
                         (|:| |lightPhi| (|DoubleFloat|))
                         (|:| |translucence| (|DoubleFloat|))))
                (|:| |perspective|
                     (|Record| (|:| |perspectiveField| (|Integer|))
                         (|:| |eyeDistance| (|DoubleFloat|))
                         (|:| |hitherPlane| (|DoubleFloat|))))
                (|:| |volume|
                     (|Record| (|:| |clipXMin| (|DoubleFloat|))
                         (|:| |clipXMax| (|DoubleFloat|))
                         (|:| |clipYMin| (|DoubleFloat|))
                         (|:| |clipYMax| (|DoubleFloat|))
                         (|:| |clipZMin| (|DoubleFloat|))
                         (|:| |clipZMax| (|DoubleFloat|))
                         (|:| |clipRegionField| (|Integer|))
                         (|:| |clipSurfaceField| (|Integer|))))
                (|:| |space3D| (|ThreeSpace| (|DoubleFloat|)))
                (|:| |optionsField| (|List| (|DrawOption|)))))
        (QSETREFV $ 14
            (SPADCALL (SPADCALL (QREFELT $ 8))
                (SPADCALL 180 0 10 (QREFELT $ 12)) (QREFELT $ 13)))
        (QSETREFV $ 15 (/ (FLOAT PI MOST-POSITIVE-DOUBLE-FLOAT) 180))
        (QSETREFV $ 20
            (SPADCALL
                (SPADCALL
                    (SPADCALL (SPADCALL (QREFELT $ 8))
                        (SPADCALL 4 0 10 (QREFELT $ 12))
                        (QREFELT $ 13))
                    (QREFELT $ 17))
                (QREFELT $ 19)))
        (QSETREFV $ 22
            (SPADCALL
                (SPADCALL
                    (SPADCALL
                        (SPADCALL (SPADCALL (QREFELT $ 8))
                            (SPADCALL 4 0 10 (QREFELT $ 12))
                            (QREFELT $ 13))
                        (QREFELT $ 21))
                    (QREFELT $ 17))
                (QREFELT $ 19)))
        (QSETREFV $ 23
            (SPADCALL
                (SPADCALL (SPADCALL 12 -1 10 (QREFELT $ 12))
                    (QREFELT $ 17))
                (QREFELT $ 19)))
        (QSETREFV $ 24 (SPADCALL 0.0 (QREFELT $ 19)))
        (QSETREFV $ 25 (SPADCALL 0.0 (QREFELT $ 19)))
        $)))) 

(MAKEPROP '|ThreeDimensionalViewport| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL '|Rep| (|Float|) (0 . |pi|)
             (4 . |Zero|) (|Integer|) (|PositiveInteger|) (8 . |float|)
             (15 . /) '|degrees| '|degreesSF| (|DoubleFloat|)
             (21 . |convert|) (|Reference| 16) (26 . |ref|)
             '|defaultTheta| (31 . -) '|defaultPhi| '|defaultZoom|
             '|defaultDeltaX| '|defaultDeltaY| (36 . |One|) (40 . *)
             (46 . |convert|) (51 . |asin|) (56 . |atan|) (|String|)
             (|List| 54) (|DrawOptionFunctions0|) (61 . |title|)
             (67 . |style|) (73 . |deref|)
             (|Record| (|:| |theta| 16) (|:| |phi| 16) (|:| |scale| 16)
                 (|:| |scaleX| 16) (|:| |scaleY| 16) (|:| |scaleZ| 16)
                 (|:| |deltaX| 16) (|:| |deltaY| 16))
             (78 . |viewpoint|) (|List| 42) (|ViewDefaultsPackage|)
             (84 . |viewPosDefault|) (|NonNegativeInteger|)
             (88 . |elt|) (|List| 11) (94 . |viewSizeDefault|)
             (98 . |elt|) (|ThreeSpace| 16) (104 . |create3Space|)
             |VIEW3D;viewport3D;$;5| |VIEW3D;subspace;$Ts;6|
             |VIEW3D;subspace;$Ts$;7| |VIEW3D;options;$L;8|
             |VIEW3D;options;$L$;9| (|DrawOption|) (108 . |title|)
             |VIEW3D;makeViewport3D;2$;12|
             |VIEW3D;makeViewport3D;TsS$;10|
             |VIEW3D;makeViewport3D;TsL$;11| (|Point| 16)
             (|CoordinateSystems| 16) (113 . |cartesian|)
             (|Mapping| 59 59) (118 . |coord|) (124 . |check|)
             (|List| 59) (129 . |lp|) (|List| (|List| 39))
             (134 . |lllip|) (|List| 71) (139 . |llprop|) (|List| 86)
             (144 . |lprop|) (|Set| 11) (149 . |brace|)
             (153 . |dimension|) (158 . |insert!|) (164 . |#|)
             (169 . |parts|) (174 . |size|) (|PointPackage| 16)
             (178 . |xCoord|) (183 . |yCoord|) (188 . |zCoord|)
             (193 . |color|) (|Boolean|) (|SubSpaceComponentProperty|)
             (198 . |closed?|) (203 . |solid?|) (208 . |#|)
             (213 . |elt|) |VIEW3D;viewThetaDefault;F;13|
             (218 . |setelt|) |VIEW3D;viewThetaDefault;2F;14|
             |VIEW3D;viewPhiDefault;F;15| |VIEW3D;viewPhiDefault;2F;16|
             |VIEW3D;viewZoomDefault;F;17|
             |VIEW3D;viewZoomDefault;2F;18|
             |VIEW3D;viewDeltaXDefault;F;19|
             |VIEW3D;viewDeltaXDefault;2F;20|
             |VIEW3D;viewDeltaYDefault;F;21|
             |VIEW3D;viewDeltaYDefault;2F;22| |VIEW3D;key;$I;43|
             (|Void|) |VIEW3D;lighting;$3FV;23| |VIEW3D;axes;$SV;24|
             |VIEW3D;diagonals;$SV;25| |VIEW3D;outlineRender;$SV;26|
             |VIEW3D;controlPanel;$SV;27| |VIEW3D;drawStyle;$SV;28|
             |VIEW3D;reset;$V;29| |VIEW3D;close;$V;30|
             |VIEW3D;viewpoint;$R;31| |VIEW3D;viewpoint;$RV;32|
             |VIEW3D;viewpoint;$5FV;33| |VIEW3D;viewpoint;$2I3FV;34|
             |VIEW3D;viewpoint;$2FV;35| (224 . =) (230 . <) (236 . *)
             (242 . +) (248 . |sqrt|) |VIEW3D;rotate;$2FV;45|
             |VIEW3D;viewpoint;$3FV;36| |VIEW3D;title;$SV;37| (|Color|)
             (253 . |hue|) |VIEW3D;colorDef;$2CV;38|
             |VIEW3D;dimensions;$2Nni2PiV;39| |VIEW3D;move;$2NniV;40|
             |VIEW3D;resize;$2PiV;41| (|OutputForm|) (258 . |coerce|)
             (|List| $) (263 . |hconcat|) |VIEW3D;coerce;$Of;42|
             (268 . |coerce|) |VIEW3D;rotate;$2IV;44|
             |VIEW3D;zoom;$FV;46| |VIEW3D;zoom;$3FV;47|
             |VIEW3D;translate;$2FV;48| |VIEW3D;intensity;$FV;49|
             (|List| 31) |VIEW3D;write;$SLS;52| |VIEW3D;write;$3S;50|
             (273 . |viewWriteDefault|) |VIEW3D;write;$2S;51|
             (277 . |viewWriteAvailable|) (281 . |minIndex|)
             (286 . |upperCase|) (291 . |position|)
             |VIEW3D;perspective;$SV;53| |VIEW3D;showRegion;$SV;54|
             |VIEW3D;showClipRegion;$SV;55| |VIEW3D;clipSurface;$SV;56|
             |VIEW3D;eyeDistance;$FV;57| |VIEW3D;hitherPlane;$FV;58|
             (297 . |modifyPointData|)
             |VIEW3D;modifyPointData;$NniPV;59| (|SingleInteger|))
          '#(~= 304 |zoom| 310 |write| 324 |viewport3D| 344 |viewpoint|
             348 |viewZoomDefault| 394 |viewThetaDefault| 403
             |viewPhiDefault| 412 |viewDeltaYDefault| 421
             |viewDeltaXDefault| 430 |translate| 439 |title| 446
             |subspace| 452 |showRegion| 463 |showClipRegion| 469
             |rotate| 475 |resize| 489 |reset| 496 |perspective| 501
             |outlineRender| 507 |options| 513 |move| 524
             |modifyPointData| 531 |makeViewport3D| 538 |lighting| 555
             |latex| 563 |key| 568 |intensity| 573 |hitherPlane| 579
             |hash| 585 |eyeDistance| 590 |drawStyle| 596 |dimensions|
             602 |diagonals| 611 |controlPanel| 617 |colorDef| 623
             |coerce| 630 |close| 635 |clipSurface| 640 |axes| 646 =
             652)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0 0))
                (CONS '#(|SetCategory&| |BasicType&| NIL)
                      (CONS '#((|SetCategory|) (|BasicType|)
                               (|CoercibleTo| 131))
                            (|makeByteWordVec2| 159
                                '(0 7 0 8 0 7 0 9 3 7 0 10 10 11 12 2 7
                                  0 0 0 13 1 7 16 0 17 1 18 0 16 19 1 7
                                  0 0 21 0 7 0 26 2 16 0 11 0 27 1 7 0
                                  16 28 1 7 0 0 29 1 7 0 0 30 2 33 31
                                  32 31 34 2 33 31 32 31 35 1 18 16 0
                                  36 2 33 37 32 37 38 0 40 39 41 2 39
                                  42 0 10 43 0 40 44 45 2 44 11 0 10 46
                                  0 47 0 48 1 54 0 31 55 1 60 59 59 61
                                  2 33 62 32 62 63 1 47 0 0 64 1 47 65
                                  0 66 1 47 67 0 68 1 47 69 0 70 1 47
                                  71 0 72 0 73 0 74 1 59 11 0 75 2 73 0
                                  11 0 76 1 73 42 0 77 1 73 44 0 78 0
                                  73 42 79 1 80 16 59 81 1 80 16 59 82
                                  1 80 16 59 83 1 80 16 59 84 1 86 85 0
                                  87 1 86 85 0 88 1 39 42 0 89 1 18 16
                                  0 90 2 18 16 0 16 92 2 7 85 0 0 117 2
                                  7 85 0 0 118 2 7 0 0 0 119 2 7 0 0 0
                                  120 1 7 0 0 121 1 125 10 0 126 1 31
                                  131 0 132 1 131 0 133 134 1 7 0 10
                                  136 0 40 142 145 0 40 142 147 1 142
                                  10 0 148 1 31 0 0 149 2 142 10 31 0
                                  150 3 47 0 0 42 59 157 2 0 85 0 0 1 4
                                  0 103 0 7 7 7 139 2 0 103 0 7 138 3 0
                                  31 0 31 142 143 2 0 31 0 31 146 3 0
                                  31 0 31 31 144 0 0 0 49 3 0 103 0 7 7
                                  116 4 0 103 0 7 7 7 123 2 0 103 0 37
                                  113 6 0 103 0 10 10 7 7 7 115 1 0 37
                                  0 112 6 0 103 0 7 7 7 7 7 114 1 0 7 7
                                  97 0 0 7 96 1 0 7 7 93 0 0 7 91 1 0 7
                                  7 95 0 0 7 94 1 0 7 7 101 0 0 7 100 1
                                  0 7 7 99 0 0 7 98 3 0 103 0 7 7 140 2
                                  0 103 0 31 124 1 0 47 0 50 2 0 0 0 47
                                  51 2 0 103 0 31 152 2 0 103 0 31 153
                                  3 0 103 0 10 10 137 3 0 103 0 7 7 122
                                  3 0 103 0 11 11 130 1 0 103 0 110 2 0
                                  103 0 31 151 2 0 103 0 31 107 2 0 0 0
                                  32 53 1 0 32 0 52 3 0 103 0 42 42 129
                                  3 0 103 0 42 59 158 2 0 0 47 31 57 2
                                  0 0 47 32 58 1 0 0 0 56 4 0 103 0 7 7
                                  7 104 1 0 31 0 1 1 0 10 0 102 2 0 103
                                  0 7 141 2 0 103 0 7 156 1 0 159 0 1 2
                                  0 103 0 7 155 2 0 103 0 31 109 5 0
                                  103 0 42 42 11 11 128 2 0 103 0 31
                                  106 2 0 103 0 31 108 3 0 103 0 125
                                  125 127 1 0 131 0 135 1 0 103 0 111 2
                                  0 103 0 31 154 2 0 103 0 31 105 2 0
                                  85 0 0 1)))))
          '|lookupComplete|)) 

(MAKEPROP '|ThreeDimensionalViewport| 'NILADIC T) 
