
(/VERSIONCHECK 2) 

(PUT '|SCIFS;indexes;$L;1| '|SPADreplace| 'QCAR) 

(DEFUN |SCIFS;indexes;$L;1| (|me| $) (QCAR |me|)) 

(PUT '|SCIFS;pointList;$L;2| '|SPADreplace| 'QCDR) 

(DEFUN |SCIFS;pointList;$L;2| (|me| $) (QCDR |me|)) 

(DEFUN |SCIFS;meshIndex| (|i| |j| |c| $)
  (PROG (#1=#:G1809)
    (RETURN
     (PROG1 (LETT #1# (+ (* |j| |c|) |i|) |SCIFS;meshIndex|)
       (|check-subtype| (>= #1# 0) '(|NonNegativeInteger|) #1#))))) 

(DEFUN |SCIFS;smesh;LB$;4| (|ptin| |clos| $)
  (PROG (|j| |in2| |thisLine| |i| |pt2| #1=#:G1832 |p| #2=#:G1831 |lpt|
         |colLength| |rowLength|)
    (RETURN
     (SEQ (LETT |pt2| NIL . #3=(|SCIFS;smesh;LB$;4|)) (LETT |in2| NIL . #3#)
          (LETT |rowLength| (LENGTH |ptin|) . #3#)
          (LETT |colLength| (LENGTH (|SPADfirst| |ptin|)) . #3#)
          (LETT |j| 0 . #3#)
          (SEQ (LETT |lpt| NIL . #3#) (LETT #2# |ptin| . #3#) G190
               (COND
                ((OR (ATOM #2#) (PROGN (LETT |lpt| (CAR #2#) . #3#) NIL))
                 #4=(GO G191)))
               (SEQ (LETT |i| 0 . #3#)
                    (SEQ (LETT |p| NIL . #3#) (LETT #1# |lpt| . #3#) G190
                         (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |p| (CAR #1#) . #3#) NIL))
                           #4#))
                         (SEQ
                          (LETT |pt2| (SPADCALL |pt2| |p| (QREFELT $ 12))
                                . #3#)
                          (COND
                           ((< 0 |i|)
                            (COND
                             ((< 0 |j|)
                              (SEQ
                               (LETT |thisLine|
                                     (LIST
                                      (|SCIFS;meshIndex| (- |i| 1) (- |j| 1)
                                       |colLength| $)
                                      (|SCIFS;meshIndex| |i| (- |j| 1)
                                       |colLength| $)
                                      (|SCIFS;meshIndex| |i| |j| |colLength| $)
                                      (|SCIFS;meshIndex| (- |i| 1) |j|
                                       |colLength| $))
                                     . #3#)
                               (EXIT
                                (LETT |in2|
                                      (SPADCALL |in2| |thisLine|
                                                (QREFELT $ 14))
                                      . #3#)))))))
                          (EXIT (LETT |i| (+ |i| 1) . #3#)))
                         (LETT #1# (CDR #1#) . #3#) #5=(GO G190) G191
                         (EXIT NIL))
                    (COND
                     (|clos|
                      (COND
                       ((< 0 |j|)
                        (SEQ
                         (LETT |thisLine|
                               (LIST
                                (|SCIFS;meshIndex| (- |i| 1) (- |j| 1)
                                 |colLength| $)
                                (|SCIFS;meshIndex| 0 (- |j| 1) |colLength| $)
                                (|SCIFS;meshIndex| 0 |j| |colLength| $)
                                (|SCIFS;meshIndex| (- |i| 1) |j| |colLength|
                                 $))
                               . #3#)
                         (EXIT
                          (LETT |in2|
                                (SPADCALL |in2| |thisLine| (QREFELT $ 14))
                                . #3#)))))))
                    (EXIT (LETT |j| (+ |j| 1) . #3#)))
               (LETT #2# (CDR #2#) . #3#) #5# G191 (EXIT NIL))
          (EXIT (CONS |in2| |pt2|)))))) 

(DEFUN |SCIFS;singleFace;L$;5| (|ptin| $)
  (PROG (|in2| #1=#:G1838 |i| #2=#:G1837 |pt2|)
    (RETURN
     (SEQ (LETT |pt2| |ptin| . #3=(|SCIFS;singleFace;L$;5|))
          (LETT |in2|
                (LIST
                 (PROGN
                  (LETT #2# NIL . #3#)
                  (SEQ (LETT |i| 0 . #3#)
                       (LETT #1# (- (LENGTH |ptin|) 1) . #3#) G190
                       (COND ((QSGREATERP |i| #1#) (GO G191)))
                       (SEQ (EXIT (LETT #2# (CONS |i| #2#) . #3#)))
                       (LETT |i| (QSADD1 |i|) . #3#) (GO G190) G191
                       (EXIT (NREVERSE0 #2#)))))
                . #3#)
          (EXIT (CONS |in2| |pt2|)))))) 

(DEFUN |SCIFS;subdivide;2$;6| (|me| $)
  (PROG (|indexSize| |in2| |indexPos| |newFace| #1=#:G1856 |j| #2=#:G1855
         #3=#:G1854 |ptIx| |pt2| |newPt| #4=#:G1853 #5=#:G1852 |faceIx| |i|
         #6=#:G1851)
    (RETURN
     (SEQ (LETT |indexSize| (LENGTH (QCDR |me|)) . #7=(|SCIFS;subdivide;2$;6|))
          (LETT |pt2|
                (PROGN
                 (LETT #6# NIL . #7#)
                 (SEQ (LETT |i| 1 . #7#) G190
                      (COND ((QSGREATERP |i| |indexSize|) #8=(GO G191)))
                      (SEQ
                       (EXIT
                        (LETT #6#
                              (CONS (SPADCALL (QCDR |me|) |i| (QREFELT $ 20))
                                    #6#)
                              . #7#)))
                      (LETT |i| (QSADD1 |i|) . #7#) #9=(GO G190) G191
                      (EXIT (NREVERSE0 #6#))))
                . #7#)
          (LETT |in2| NIL . #7#)
          (SEQ (LETT |faceIx| NIL . #7#) (LETT #5# (QCAR |me|) . #7#) G190
               (COND
                ((OR (ATOM #5#) (PROGN (LETT |faceIx| (CAR #5#) . #7#) NIL))
                 #8#))
               (SEQ (LETT |newPt| (SPADCALL 0 0 0 (QREFELT $ 21)) . #7#)
                    (SEQ (LETT |ptIx| NIL . #7#) (LETT #4# |faceIx| . #7#) G190
                         (COND
                          ((OR (ATOM #4#)
                               (PROGN (LETT |ptIx| (CAR #4#) . #7#) NIL))
                           #8#))
                         (SEQ
                          (EXIT
                           (LETT |newPt|
                                 (SPADCALL |newPt|
                                           (SPADCALL |pt2| (+ |ptIx| 1)
                                                     (QREFELT $ 20))
                                           (QREFELT $ 22))
                                 . #7#)))
                         (LETT #4# (CDR #4#) . #7#) #9# G191 (EXIT NIL))
                    (LETT |newPt|
                          (SPADCALL
                           (DIV-DF-I 1.0 (SPADCALL |faceIx| (QREFELT $ 24)))
                           |newPt| (QREFELT $ 26))
                          . #7#)
                    (LETT |pt2| (SPADCALL |pt2| |newPt| (QREFELT $ 12)) . #7#)
                    (LETT |indexPos| 1 . #7#)
                    (SEQ (LETT |ptIx| NIL . #7#) (LETT #3# |faceIx| . #7#) G190
                         (COND
                          ((OR (ATOM #3#)
                               (PROGN (LETT |ptIx| (CAR #3#) . #7#) NIL))
                           #8#))
                         (SEQ
                          (LETT |newFace|
                                (PROGN
                                 (LETT #2# NIL . #7#)
                                 (SEQ (LETT |j| 1 . #7#)
                                      (LETT #1#
                                            (SPADCALL |faceIx| (QREFELT $ 24))
                                            . #7#)
                                      G190 (COND ((QSGREATERP |j| #1#) #8#))
                                      (SEQ
                                       (EXIT
                                        (LETT #2#
                                              (CONS
                                               (SPADCALL |faceIx| |j|
                                                         (QREFELT $ 27))
                                               #2#)
                                              . #7#)))
                                      (LETT |j| (QSADD1 |j|) . #7#) #9# G191
                                      (EXIT (NREVERSE0 #2#))))
                                . #7#)
                          (SPADCALL |newFace| |indexPos| |indexSize|
                                    (QREFELT $ 28))
                          (LETT |indexPos| (+ |indexPos| 1) . #7#)
                          (EXIT
                           (LETT |in2|
                                 (SPADCALL |in2| |newFace| (QREFELT $ 14))
                                 . #7#)))
                         (LETT #3# (CDR #3#) . #7#) #9# G191 (EXIT NIL))
                    (EXIT (LETT |indexSize| (+ |indexSize| 1) . #7#)))
               (LETT #5# (CDR #5#) . #7#) #9# G191 (EXIT NIL))
          (EXIT (CONS |in2| |pt2|)))))) 

(DEFUN |SCIFS;sierpinskiDivide;$Nni$;7| (|me| |level| $)
  (PROG (#1=#:G1868 #2=#:G1870 |indexSize| |in2| |index2| |index1| |newFace|
         |ix4| |ix3| #3=#:G1874 |offset| #4=#:G1861 |pt2| |newPt| |ix2| |ix1|
         #5=#:G1873 #6=#:G1872 |faceIx| |i| #7=#:G1871)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |indexSize| (LENGTH (QCDR |me|))
              . #8=(|SCIFS;sierpinskiDivide;$Nni$;7|))
        (LETT |pt2|
              (PROGN
               (LETT #7# NIL . #8#)
               (SEQ (LETT |i| 1 . #8#) G190
                    (COND ((QSGREATERP |i| |indexSize|) #9=(GO G191)))
                    (SEQ
                     (EXIT
                      (LETT #7#
                            (CONS (SPADCALL (QCDR |me|) |i| (QREFELT $ 20))
                                  #7#)
                            . #8#)))
                    (LETT |i| (QSADD1 |i|) . #8#) #10=(GO G190) G191
                    (EXIT (NREVERSE0 #7#))))
              . #8#)
        (LETT |in2| NIL . #8#)
        (SEQ (LETT |faceIx| NIL . #8#) (LETT #6# (QCAR |me|) . #8#) G190
             (COND
              ((OR (ATOM #6#) (PROGN (LETT |faceIx| (CAR #6#) . #8#) NIL))
               #9#))
             (SEQ
              (SEQ (LETT |offset| 1 . #8#)
                   (LETT #5# (SPADCALL |faceIx| (QREFELT $ 24)) . #8#) G190
                   (COND ((QSGREATERP |offset| #5#) #9#))
                   (SEQ (LETT |ix1| |offset| . #8#)
                        (LETT |ix2| (+ |offset| 1) . #8#)
                        (COND
                         ((< (SPADCALL |faceIx| (QREFELT $ 24)) |ix2|)
                          (LETT |ix2| 1 . #8#)))
                        (LETT |newPt|
                              (SPADCALL
                               (SPADCALL |pt2|
                                         (+
                                          (SPADCALL |faceIx| |ix1|
                                                    (QREFELT $ 27))
                                          1)
                                         (QREFELT $ 20))
                               (SPADCALL |pt2|
                                         (+
                                          (SPADCALL |faceIx| |ix2|
                                                    (QREFELT $ 27))
                                          1)
                                         (QREFELT $ 20))
                               (QREFELT $ 22))
                              . #8#)
                        (LETT |newPt|
                              (SPADCALL
                               (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 32))
                                         (QREFELT $ 33))
                               |newPt| (QREFELT $ 26))
                              . #8#)
                        (EXIT
                         (LETT |pt2| (SPADCALL |pt2| |newPt| (QREFELT $ 12))
                               . #8#)))
                   (LETT |offset| (QSADD1 |offset|) . #8#) #10# G191
                   (EXIT NIL))
              (LETT |index1|
                    (PROG1
                        (LETT #4# (- (SPADCALL |faceIx| (QREFELT $ 24)) 1)
                              . #8#)
                      (|check-subtype| (>= #4# 0) '(|NonNegativeInteger|) #4#))
                    . #8#)
              (LETT |index2| 0 . #8#)
              (SEQ (LETT |offset| 1 . #8#)
                   (LETT #3# (SPADCALL |faceIx| (QREFELT $ 24)) . #8#) G190
                   (COND ((QSGREATERP |offset| #3#) #9#))
                   (SEQ (LETT |ix3| (+ |indexSize| |index1|) . #8#)
                        (LETT |ix4| (+ |indexSize| |index2|) . #8#)
                        (LETT |newFace|
                              (LIST (SPADCALL |faceIx| |offset| (QREFELT $ 27))
                                    |ix3| |ix4|)
                              . #8#)
                        (LETT |index1| (+ |index1| 1) . #8#)
                        (COND
                         ((EQL |index1| (SPADCALL |faceIx| (QREFELT $ 24)))
                          (LETT |index1| 0 . #8#)))
                        (LETT |index2| (+ |index2| 1) . #8#)
                        (COND
                         ((EQL |index2| (SPADCALL |faceIx| (QREFELT $ 24)))
                          (LETT |index2| 0 . #8#)))
                        (EXIT
                         (LETT |in2| (SPADCALL |in2| |newFace| (QREFELT $ 14))
                               . #8#)))
                   (LETT |offset| (QSADD1 |offset|) . #8#) #10# G191
                   (EXIT NIL))
              (EXIT
               (LETT |indexSize|
                     (+ |indexSize| (SPADCALL |faceIx| (QREFELT $ 24)))
                     . #8#)))
             (LETT #6# (CDR #6#) . #8#) #10# G191 (EXIT NIL))
        (COND
         ((< |level| 1) (PROGN (LETT #2# (CONS |in2| |pt2|) . #8#) (GO #2#))))
        (EXIT
         (SPADCALL (CONS |in2| |pt2|)
                   (PROG1 (LETT #1# (- |level| 1) . #8#)
                     (|check-subtype| (>= #1# 0) '(|NonNegativeInteger|) #1#))
                   (QREFELT $ 34)))))
      #2# (EXIT #2#))))) 

(DEFUN |SCIFS;displayIFS;$V;8| (|me| $)
  (PROG (|ptStr| #1=#:G1885 |pIx| #2=#:G1884 |faceIx| #3=#:G1883 |p|)
    (RETURN
     (SEQ (LETT |ptStr| NIL . #4=(|SCIFS;displayIFS;$V;8|))
          (SEQ (LETT |p| NIL . #4#) (LETT #3# (QCDR |me|) . #4#) G190
               (COND
                ((OR (ATOM #3#) (PROGN (LETT |p| (CAR #3#) . #4#) NIL))
                 #5=(GO G191)))
               (SEQ
                (LETT |ptStr|
                      (SPADCALL |ptStr| (|mathObject2String| |p|)
                                (QREFELT $ 37))
                      . #4#)
                (EXIT
                 (LETT |ptStr| (SPADCALL |ptStr| " " (QREFELT $ 37)) . #4#)))
               (LETT #3# (CDR #3#) . #4#) #6=(GO G190) G191 (EXIT NIL))
          (|sayTeX| |ptStr|)
          (SEQ (LETT |faceIx| NIL . #4#) (LETT #2# (QCAR |me|) . #4#) G190
               (COND
                ((OR (ATOM #2#) (PROGN (LETT |faceIx| (CAR #2#) . #4#) NIL))
                 #5#))
               (SEQ (LETT |ptStr| NIL . #4#)
                    (SEQ (LETT |pIx| NIL . #4#) (LETT #1# |faceIx| . #4#) G190
                         (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |pIx| (CAR #1#) . #4#) NIL))
                           #5#))
                         (SEQ
                          (LETT |ptStr|
                                (SPADCALL |ptStr| (|mathObject2String| |pIx|)
                                          (QREFELT $ 37))
                                . #4#)
                          (EXIT
                           (LETT |ptStr| (SPADCALL |ptStr| " " (QREFELT $ 37))
                                 . #4#)))
                         (LETT #1# (CDR #1#) . #4#) #6# G191 (EXIT NIL))
                    (EXIT (|sayTeX| |ptStr|)))
               (LETT #2# (CDR #2#) . #4#) #6# G191 (EXIT NIL))
          (EXIT (|Void|)))))) 

(DEFUN |SCIFS;listBranches| (|functions| $)
  (PROG (|outList| #1=#:G1890 |curve|)
    (RETURN
     (SEQ (LETT |outList| NIL . #2=(|SCIFS;listBranches|))
          (SEQ (LETT |curve| NIL . #2#) (LETT #1# |functions| . #2#) G190
               (COND
                ((OR (ATOM #1#) (PROGN (LETT |curve| (CAR #1#) . #2#) NIL))
                 (GO G191)))
               (SEQ
                (EXIT
                 (LETT |outList| (CONS (QVELT |curve| 3) |outList|) . #2#)))
               (LETT #1# (CDR #1#) . #2#) (GO G190) G191 (EXIT NIL))
          (EXIT |outList|))))) 

(DEFUN |SCIFS;orthog| (|x| |y| $)
  (PROG (|a|)
    (RETURN
     (SEQ
      (COND
       ((LESS-DF (QREFELT $ 41) (SPADCALL |x| |y| (QREFELT $ 46)))
        (LETT |y| (QREFELT $ 45) . #1=(|SCIFS;orthog|))))
      (COND
       ((LESS-DF (QREFELT $ 41) (SPADCALL |x| |y| (QREFELT $ 46)))
        (LETT |y|
              (COND
               ((LESS-DF (SPADCALL |x| (QREFELT $ 42) (QREFELT $ 46))
                         (QREFELT $ 41))
                (QREFELT $ 42))
               ('T (QREFELT $ 43)))
              . #1#)))
      (LETT |a|
            (MINUS-DF
             (DIV-DF (SPADCALL |x| |y| (QREFELT $ 47))
                     (SPADCALL |x| |x| (QREFELT $ 47))))
            . #1#)
      (EXIT
       (SETELT $ 45
               (SPADCALL (SPADCALL |a| |x| (QREFELT $ 26)) |y|
                         (QREFELT $ 22)))))))) 

(DEFUN |SCIFS;poTriad| (|pl| |po| |pr| $)
  (PROG (|n| |pol| |t|)
    (RETURN
     (SEQ
      (LETT |t| (SPADCALL (SPADCALL |pr| |pl| (QREFELT $ 48)) (QREFELT $ 49))
            . #1=(|SCIFS;poTriad|))
      (LETT |pol| (SPADCALL |pl| |po| (QREFELT $ 48)) . #1#)
      (LETT |n| (SPADCALL (|SCIFS;orthog| |t| |pol| $) (QREFELT $ 49)) . #1#)
      (EXIT (VECTOR |t| |n| (SPADCALL |t| |n| (QREFELT $ 50)))))))) 

(DEFUN |SCIFS;curveTriads| (|l| $)
  (PROG (|endtriad| |n| |t| |x| |begtriad| |midtriads| #1=#:G1909 |pl|
         #2=#:G1910 |po| #3=#:G1911 |pr| #4=#:G1908 |triad| |b| |k|)
    (RETURN
     (SEQ (LETT |k| (LENGTH |l|) . #5=(|SCIFS;curveTriads|))
          (EXIT
           (COND
            ((< |k| 2) (|error| "Need at least 2 points to specify a curve"))
            (#6='T
             (SEQ (SETELT $ 45 (QREFELT $ 44))
                  (EXIT
                   (COND
                    ((EQL |k| 2)
                     (SEQ
                      (LETT |t|
                            (SPADCALL
                             (SPADCALL (SPADCALL |l| (QREFELT $ 51))
                                       (|SPADfirst| |l|) (QREFELT $ 48))
                             (QREFELT $ 49))
                            . #5#)
                      (LETT |n|
                            (SPADCALL
                             (SPADCALL |t| (QREFELT $ 42) (QREFELT $ 48))
                             (QREFELT $ 49))
                            . #5#)
                      (LETT |b| (SPADCALL |t| |n| (QREFELT $ 50)) . #5#)
                      (LETT |triad| (VECTOR |t| |n| |b|) . #5#)
                      (EXIT (LIST |triad| |triad|))))
                    (#6#
                     (SEQ
                      (LETT |midtriads|
                            (PROGN
                             (LETT #4# NIL . #5#)
                             (SEQ (LETT |pr| NIL . #5#)
                                  (LETT #3# (CDR (CDR |l|)) . #5#)
                                  (LETT |po| NIL . #5#)
                                  (LETT #2# (CDR |l|) . #5#)
                                  (LETT |pl| NIL . #5#) (LETT #1# |l| . #5#)
                                  G190
                                  (COND
                                   ((OR (ATOM #1#)
                                        (PROGN (LETT |pl| (CAR #1#) . #5#) NIL)
                                        (ATOM #2#)
                                        (PROGN (LETT |po| (CAR #2#) . #5#) NIL)
                                        (ATOM #3#)
                                        (PROGN
                                         (LETT |pr| (CAR #3#) . #5#)
                                         NIL))
                                    (GO G191)))
                                  (SEQ
                                   (EXIT
                                    (LETT #4#
                                          (CONS
                                           (|SCIFS;poTriad| |pl| |po| |pr| $)
                                           #4#)
                                          . #5#)))
                                  (LETT #1#
                                        (PROG1 (CDR #1#)
                                          (LETT #2#
                                                (PROG1 (CDR #2#)
                                                  (LETT #3# (CDR #3#) . #5#))
                                                . #5#))
                                        . #5#)
                                  (GO G190) G191 (EXIT (NREVERSE0 #4#))))
                            . #5#)
                      (LETT |x| (|SPADfirst| |midtriads|) . #5#)
                      (LETT |t|
                            (SPADCALL
                             (SPADCALL (SPADCALL |l| (QREFELT $ 51))
                                       (|SPADfirst| |l|) (QREFELT $ 48))
                             (QREFELT $ 49))
                            . #5#)
                      (LETT |n|
                            (SPADCALL (|SCIFS;orthog| |t| (QVELT |x| 1) $)
                                      (QREFELT $ 49))
                            . #5#)
                      (LETT |begtriad|
                            (VECTOR |t| |n| (SPADCALL |t| |n| (QREFELT $ 50)))
                            . #5#)
                      (LETT |x| (SPADCALL |midtriads| (QREFELT $ 54)) . #5#)
                      (LETT |t|
                            (SPADCALL
                             (SPADCALL (SPADCALL |l| |k| (QREFELT $ 20))
                                       (SPADCALL |l| (- |k| 1) (QREFELT $ 20))
                                       (QREFELT $ 48))
                             (QREFELT $ 49))
                            . #5#)
                      (LETT |n|
                            (SPADCALL (|SCIFS;orthog| |t| (QVELT |x| 1) $)
                                      (QREFELT $ 49))
                            . #5#)
                      (LETT |endtriad|
                            (VECTOR |t| |n| (SPADCALL |t| |n| (QREFELT $ 50)))
                            . #5#)
                      (EXIT
                       (CONS |begtriad|
                             (SPADCALL |midtriads| |endtriad|
                                       (QREFELT $ 55)))))))))))))))) 

(DEFUN |SCIFS;cosSinInfo| (|n| $)
  (PROG (|ans| |angle| #1=#:G1919 |i| |theta|)
    (RETURN
     (SEQ (LETT |ans| NIL . #2=(|SCIFS;cosSinInfo|))
          (LETT |theta|
                (DIV-DF-I
                 (SPADCALL 2 (FLOAT PI MOST-POSITIVE-DOUBLE-FLOAT)
                           (QREFELT $ 56))
                 |n|)
                . #2#)
          (SEQ (LETT |i| 1 . #2#) (LETT #1# (- |n| 1) . #2#) G190
               (COND ((QSGREATERP |i| #1#) (GO G191)))
               (SEQ (LETT |angle| (SPADCALL |i| |theta| (QREFELT $ 57)) . #2#)
                    (EXIT
                     (LETT |ans|
                           (CONS (LIST (COS-DF |angle|) (SIN-DF |angle|))
                                 |ans|)
                           . #2#)))
               (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191 (EXIT NIL))
          (EXIT |ans|))))) 

(DEFUN |SCIFS;loopPoints| (|ctr| |pNorm| |bNorm| |rad| |cosSin| $)
  (PROG (|pt| |ans| |sin| |cos| |cossin|)
    (RETURN
     (SEQ (LETT |ans| NIL . #1=(|SCIFS;loopPoints|))
          (SEQ G190
               (COND ((NULL (COND ((NULL |cosSin|) 'NIL) ('T 'T))) (GO G191)))
               (SEQ (LETT |cossin| (|SPADfirst| |cosSin|) . #1#)
                    (LETT |cos| (|SPADfirst| |cossin|) . #1#)
                    (LETT |sin| (SPADCALL |cossin| (QREFELT $ 59)) . #1#)
                    (LETT |ans|
                          (CONS
                           (SPADCALL |ctr|
                                     (SPADCALL |rad|
                                               (SPADCALL
                                                (SPADCALL |cos| |pNorm|
                                                          (QREFELT $ 26))
                                                (SPADCALL |sin| |bNorm|
                                                          (QREFELT $ 26))
                                                (QREFELT $ 22))
                                               (QREFELT $ 26))
                                     (QREFELT $ 22))
                           |ans|)
                          . #1#)
                    (EXIT (LETT |cosSin| (CDR |cosSin|) . #1#)))
               NIL (GO G190) G191 (EXIT NIL))
          (LETT |pt|
                (SPADCALL |ctr| (SPADCALL |rad| |pNorm| (QREFELT $ 26))
                          (QREFELT $ 22))
                . #1#)
          (EXIT (CONS |pt| (SPADCALL |ans| |pt| (QREFELT $ 12)))))))) 

(DEFUN |SCIFS;curveLoops;LDfIL;15| (|pts1| |r| |nn| $)
  (PROG (|loops| |b| |n| #1=#:G1928 |pt| #2=#:G1929 |triad| |cosSin| |triads|)
    (RETURN
     (SEQ
      (LETT |triads| (|SCIFS;curveTriads| |pts1| $)
            . #3=(|SCIFS;curveLoops;LDfIL;15|))
      (LETT |cosSin| (|SCIFS;cosSinInfo| |nn| $) . #3#)
      (LETT |loops| NIL . #3#)
      (SEQ (LETT |triad| NIL . #3#) (LETT #2# |triads| . #3#)
           (LETT |pt| NIL . #3#) (LETT #1# |pts1| . #3#) G190
           (COND
            ((OR (ATOM #1#) (PROGN (LETT |pt| (CAR #1#) . #3#) NIL) (ATOM #2#)
                 (PROGN (LETT |triad| (CAR #2#) . #3#) NIL))
             (GO G191)))
           (SEQ (LETT |n| (QVELT |triad| 1) . #3#)
                (LETT |b| (QVELT |triad| 2) . #3#)
                (EXIT
                 (LETT |loops|
                       (CONS (|SCIFS;loopPoints| |pt| |n| |b| |r| |cosSin| $)
                             |loops|)
                       . #3#)))
           (LETT #1# (PROG1 (CDR #1#) (LETT #2# (CDR #2#) . #3#)) . #3#)
           (GO G190) G191 (EXIT NIL))
      (EXIT (NREVERSE |loops|)))))) 

(DEFUN |SCIFS;stube;LDfI$;16| (|functions| |r| |n| $)
  (PROG (|loops| #1=#:G1937 |bran| |brans|)
    (RETURN
     (SEQ
      (COND ((< |n| 3) (|error| "tube: n should be at least 3"))
            ('T
             (SEQ
              (LETT |brans| (|SCIFS;listBranches| |functions| $)
                    . #2=(|SCIFS;stube;LDfI$;16|))
              (LETT |loops| NIL . #2#)
              (SEQ (LETT |bran| NIL . #2#) (LETT #1# |brans| . #2#) G190
                   (COND
                    ((OR (ATOM #1#) (PROGN (LETT |bran| (CAR #1#) . #2#) NIL))
                     (GO G191)))
                   (SEQ
                    (EXIT
                     (LETT |loops|
                           (SPADCALL |loops|
                                     (SPADCALL |bran| |r| |n| (QREFELT $ 60))
                                     (QREFELT $ 61))
                           . #2#)))
                   (LETT #1# (CDR #1#) . #2#) (GO G190) G191 (EXIT NIL))
              (EXIT (SPADCALL |loops| 'T (QREFELT $ 17)))))))))) 

(DEFUN |SceneIFS| (#1=#:G1938)
  (PROG ()
    (RETURN
     (PROG (#2=#:G1939)
       (RETURN
        (COND
         ((LETT #2#
                (|lassocShiftWithFunction| (LIST (|devaluate| #1#))
                                           (HGET |$ConstructorCache|
                                                 '|SceneIFS|)
                                           '|domainEqualList|)
                . #3=(|SceneIFS|))
          (|CDRwithIncrement| #2#))
         ('T
          (UNWIND-PROTECT (PROG1 (|SceneIFS;| #1#) (LETT #2# T . #3#))
            (COND ((NOT #2#) (HREM |$ConstructorCache| '|SceneIFS|))))))))))) 

(DEFUN |SceneIFS;| (|#1|)
  (PROG (|pv$| $ |dv$| DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|SceneIFS|))
      (LETT |dv$| (LIST '|SceneIFS| DV$1) . #1#)
      (LETT $ (GETREFV 66) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|SceneIFS| (LIST DV$1) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (SETF |pv$| (QREFELT $ 3))
      (QSETREFV $ 7
                (|Record| (|:| |inx| (|List| (|List| (|NonNegativeInteger|))))
                          (|:| |pts| (|List| |#1|))))
      (QSETREFV $ 41
                (SPADCALL (SPADCALL 995 -3 10 (QREFELT $ 32)) (QREFELT $ 40)))
      (QSETREFV $ 42 (SPADCALL 1 0 0 (QREFELT $ 21)))
      (QSETREFV $ 43 (SPADCALL 0 1 0 (QREFELT $ 21)))
      (QSETREFV $ 44 (SPADCALL 1 1 0 (QREFELT $ 21)))
      (QSETREFV $ 45 (QREFELT $ 44))
      $)))) 

(MAKEPROP '|SceneIFS| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) '|Rep| (|List| 13)
              |SCIFS;indexes;$L;1| (|List| 6) |SCIFS;pointList;$L;2|
              (0 . |concat|) (|List| 23) (6 . |concat|) (|List| 10) (|Boolean|)
              |SCIFS;smesh;LB$;4| |SCIFS;singleFace;L$;5| (|Integer|)
              (12 . |elt|) (18 . |sipnt|) (25 . +) (|NonNegativeInteger|)
              (31 . |#|) (|DoubleFloat|) (36 . *) (42 . |elt|) (48 . |setelt|)
              |SCIFS;subdivide;2$;6| (|PositiveInteger|) (|Float|)
              (55 . |float|) (62 . |coerce|) |SCIFS;sierpinskiDivide;$Nni$;7|
              (|String|) (|List| 35) (67 . |concat|) (|Void|)
              |SCIFS;displayIFS;$V;8| (73 . |convert|) 'LINMAX 'XHAT 'YHAT
              'PREV0 'PREV (78 . |colinearity|) (84 . |parallel|) (90 . -)
              (96 . |unitVector|) (101 . |perpendicular|) (107 . |second|)
              (|Record| (|:| |tang| 6) (|:| |norm| 6) (|:| |bin| 6))
              (|List| 52) (112 . |last|) (117 . |concat|) (123 . *) (129 . *)
              (|List| 25) (135 . |second|) |SCIFS;curveLoops;LDfIL;15|
              (140 . |concat|) (|Mapping| 6 25)
              (|Record| (|:| |source| 62)
                        (|:| |ranges| (|List| (|Segment| 25))) (|:| |knots| 58)
                        (|:| |points| 10))
              (|List| 63) |SCIFS;stube;LDfI$;16|)
           '#(|testIFS| 146 |subdivide| 150 |stube| 155 |smesh| 162
              |singleFace| 168 |sierpinskiDivide| 173 |pointList| 179 |indexes|
              184 |displayIFS| 189 |curveLoops| 194)
           'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 65
                                                 '(2 10 0 0 6 12 2 8 0 0 13 14
                                                   2 10 6 0 19 20 3 6 0 19 19
                                                   19 21 2 6 0 0 0 22 1 13 23 0
                                                   24 2 6 0 25 0 26 2 13 23 0
                                                   19 27 3 13 23 0 19 23 28 3
                                                   31 0 19 19 30 32 1 31 25 0
                                                   33 2 36 0 0 35 37 1 31 25 0
                                                   40 2 6 25 0 0 46 2 6 25 0 0
                                                   47 2 6 0 0 0 48 1 6 0 0 49 2
                                                   6 0 0 0 50 1 10 6 0 51 1 53
                                                   52 0 54 2 53 0 0 52 55 2 25
                                                   0 30 0 56 2 25 0 23 0 57 1
                                                   58 25 0 59 2 15 0 0 0 61 0 0
                                                   38 1 1 0 0 0 29 3 0 0 64 25
                                                   19 65 2 0 0 15 16 17 1 0 0
                                                   10 18 2 0 0 0 23 34 1 0 10 0
                                                   11 1 0 8 0 9 1 0 38 0 39 3 0
                                                   15 10 25 19 60)))))
           '|lookupComplete|)) 
