      SUBROUTINE COUSUR(XXX,YYY,NE)
      INCLUDE 'com_faces.f'
      INCLUDE 'com_options.f'
      DIMENSION XXX(4),YYY(4)
C
      IF (IEPSEG.GT.-1) THEN
        IFLAG = 0
        IF (NDS.EQ.3) THEN
          DO I=1,NSSUR
            IF (NE.EQ.IFSEG(I)) THEN
              S = SSEG(1,I)
              T = SSEG(2,I)
              UMST = 1.-S-T
              XS1 = S*XXX(1) + T*XXX(2) + UMST*XXX(3)
              YS1 = S*YYY(1) + T*YYY(2) + UMST*YYY(3)
              S = SSEG(3,I)
              T = SSEG(4,I)
              UMST = 1.-S-T
              XS2 = S*XXX(1) + T*XXX(2) + UMST*XXX(3)
              YS2 = S*YYY(1) + T*YYY(2) + UMST*YYY(3)
              IF (IFLAG.EQ.0) THEN
                IFLAG = 1
                CALL GSQCOL(ICCOUR)
                CALL GSCOL(ICSEG)
                CALL GSLW(IEPSEG)
              ENDIF
              CALL GSMOVE(XS1,YS1)
              CALL GSLINE(XS2,YS2)
            ENDIF
          ENDDO
          IF (IFLAG.NE.0) THEN
            CALL GSCOL(ICCOUR)
            CALL GSLW(0)
          ENDIF
        ELSE
          DO I=1,NSSUR
            IF (NE.EQ.IFSEG(I)) THEN
              SM = 1.-SSEG(1,I)
              SP = 1.+SSEG(1,I)
              TM = 1.-SSEG(2,I)
              TP = 1.+SSEG(2,I)
              XS1 = .25*(SM*TM*XXX(1)
     &            +      SP*TM*XXX(2)
     &            +      SP*TP*XXX(3)
     &            +      SM*TP*XXX(4))
              YS1 = .25*(SM*TM*YYY(1)
     &            +      SP*TM*YYY(2)
     &            +      SP*TP*YYY(3)
     &            +      SM*TP*YYY(4))
              SM = 1.-SSEG(3,I)
              SP = 1.+SSEG(3,I)
              TM = 1.-SSEG(4,I)
              TP = 1.+SSEG(4,I)
              XS2 = .25*(SM*TM*XXX(1)
     &            +      SP*TM*XXX(2)
     &            +      SP*TP*XXX(3)
     &            +      SM*TP*XXX(4))
              YS2 = .25*(SM*TM*YYY(1)
     &            +      SP*TM*YYY(2)
     &            +      SP*TP*YYY(3)
     &            +      SM*TP*YYY(4))
              IF (IFLAG.EQ.0) THEN
                IFLAG = 1
                CALL GSQCOL(ICCOUR)
                CALL GSCOL(ICSEG)
                CALL GSLW(IEPSEG)
              ENDIF
              CALL GSMOVE(XS1,YS1)
              CALL GSLINE(XS2,YS2)
            ENDIF
          ENDDO
          IF (IFLAG.NE.0) THEN
            CALL GSCOL(ICCOUR)
            CALL GSLW(0)
          ENDIF
        ENDIF
      ENDIF
C
      IF (FACPTS.GT.0..AND.ITPTS.NE.0) THEN
        IF (NDS.EQ.3) THEN
          DO I=1,NPSUR
            IF (NE.EQ.IFPOIN(I)) THEN
              S = SPOIN(1,I)
              T = SPOIN(2,I)
              UMST = 1.-S-T
              XMARK = S*XXX(1) + T*XXX(2) + UMST*XXX(3)
              YMARK = S*YYY(1) + T*YYY(2) + UMST*YYY(3)
              CALL GSQCOL(ICCOUR)
              CALL GSCOL(ICPTS)
              CALL GSMS(ITPOIN(I))
              CALL GSMARK(XMARK,YMARK)
              CALL GSCOL(ICCOUR)
            ENDIF
          ENDDO
        ELSE
          DO I=1,NPSUR
            IF (NE.EQ.IFPOIN(I)) THEN
              SM = 1.-SPOIN(1,I)
              SP = 1.+SPOIN(1,I)
              TM = 1.-SPOIN(2,I)
              TP = 1.+SPOIN(2,I)
              XMARK = .25*(SM*TM*XXX(1)
     &              +      SP*TM*XXX(2)
     &              +      SP*TP*XXX(3)
     &              +      SM*TP*XXX(4))
              YMARK = .25*(SM*TM*YYY(1)
     &              +      SP*TM*YYY(2)
     &              +      SP*TP*YYY(3)
     &              +      SM*TP*YYY(4))
              CALL GSQCOL(ICCOUR)
              CALL GSCOL(ICPTS)
              CALL GSMS(ITPOIN(I))
              CALL GSMARK(XMARK,YMARK)
              CALL GSCOL(ICCOUR)
            ENDIF
          ENDDO
        ENDIF
      ENDIF
      END
