      SUBROUTINE FRONT(ISD,X,Y,ICOUL,NN,NF,NDS)
C
      DIMENSION X(4),Y(4),ISUC(4),IPP(4),IPP3(3)
      DATA ISUC / 2,3,4,1 /
      DATA IPP  / 1,4,3,2 /
      DATA IPP3 / 1,3,2 /
C
      IF (ISD.GT.1000) THEN
        CALL GSCOL(1)
cc        CALL GSLW(3)
        CALL GSLW(2)
        IIFF = ISD/1000
        IF (NDS.EQ.3) THEN
          X(4) = X(3)
          Y(4) = Y(3)
        ENDIF
        IF (IIFF.GT.10) THEN
          I1 = MOD(IIFF,10)
          I2 = ISUC(I1)
          IF (I2.GT.NDS) I2=1
          IF (NDS.EQ.4.AND.NN.GT.NF.AND.NN.LE.3*NF) THEN
            IF (NDS.EQ.4) THEN
              I1 = IPP(I1)
              I2 = IPP(I2)
            ELSE
              I1 = IPP3(I1)
              I2 = IPP3(I2)
            ENDIF
          ENDIF
          CALL GSMOVE(X(I1),Y(I1))
          CALL GSLINE(X(I2),Y(I2))
          I1 = IIFF/10
        ELSE
          I1 = IIFF
        ENDIF
          I2 = ISUC(I1)
          IF (I2.GT.NDS) I2=1
          IF (NN.GT.NF.AND.NN.LE.3*NF) THEN
            IF (NDS.EQ.4) THEN
            I1 = IPP(I1)
            I2 = IPP(I2)
            ELSE
              I1 = IPP3(I1)
              I2 = IPP3(I2)
            ENDIF
          ENDIF
        CALL GSMOVE(X(I1),Y(I1))
        CALL GSLINE(X(I2),Y(I2))
        CALL GSLW(0)
        CALL GSCOL(ICOUL)
      ENDIF
      END
