⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dxfortranstd.f90

📁 DXF producer by Fortran
💻 F90
📖 第 1 页 / 共 5 页
字号:
                              Y3,         &     !+ Coordenate YY
                              Z3,         &     !+ Coordenate ZZ
                              X4,         &     !+ Coordenate XX - node 4
                              Y4,         &     !+ Coordenate YY
                              Z4                !+ Coordenate ZZ

    
Integer   ,Intent (in) ::     FileNum           !+ File number
                          
Character , Intent(in) ::                 &
                              Color *(*), &     !+ 3DFace Color
                              Layer *(*), &     !+ 3DFace layer
                              Ltype *(*)        !+ 3DFace "LineType"

!- End of header --------------------------------------------------------------- 
      write (FileNum,fmt='(A)')  "  0"          !+ Begin of 3DFace
      write (FileNum,fmt='(A)')  "3DFACE"         !
      write (FileNum,fmt='(A)')  "  8"          !+ Layer code
      write (FileNum,fmt='(A)')  TRIM(Layer)    !  Layer's name
      write (FileNum,fmt='(A)')  "  6"          !+ LType code
      write (FileNum,fmt='(A)')  TRIM(Ltype)    !  LType name

      if (Color=="bylayer" .or. &                
          Color=="Bylayer" .or. &
          Color=="BYLAYER")  then
         ! Nothing to do if color is bylayer
      else
         write (FileNum,fmt='(A)')  " 62"        !+ Color code
         write (FileNum,fmt='(A)')  TRIM(Color)  !
      end if
      
      write (FileNum,fmt='(A)')  " 10"           !+ Begin of 3Dface - Node 1
      write (FileNum,fmt= *   )  X1              ! 
      write (FileNum,fmt='(A)')  " 20"           !
      write (FileNum,fmt= *   )  Y1              !
      write (FileNum,fmt='(A)')  " 30"           !
      write (FileNum,fmt= *   )  Z1              !

      write (FileNum,fmt='(A)')  " 11"           !+ Begin of 3Dface - Node 2
      write (FileNum,fmt= *   )  X2              ! 
      write (FileNum,fmt='(A)')  " 21"           !
      write (FileNum,fmt= *   )  Y2              !
      write (FileNum,fmt='(A)')  " 31"           !
      write (FileNum,fmt= *   )  Z2              !

      write (FileNum,fmt='(A)')  " 12"           !+ Begin of 3Dface - Node 3
      write (FileNum,fmt= *   )  X3              ! 
      write (FileNum,fmt='(A)')  " 22"           !
      write (FileNum,fmt= *   )  Y3              !
      write (FileNum,fmt='(A)')  " 32"           !
      write (FileNum,fmt= *   )  Z3              !

      write (FileNum,fmt='(A)')  " 13"           !+ Begin of 3Dface - Node 4
      write (FileNum,fmt= *   )  X4              ! 
      write (FileNum,fmt='(A)')  " 23"           !
      write (FileNum,fmt= *   )  Y4              !
      write (FileNum,fmt='(A)')  " 33"           !
      write (FileNum,fmt= *   )  Z4              !

 return
 end subroutine df3DFace

!
!+ Draw a Ponit in DXF format.
! 
Subroutine dfpoint    & 
          (FileNum,   &
           Layer,     &
           Color,     &
           X,         &
           Y,         &
           Z,         &
		   Thick)   
!
! Description: 
! 
! Draw a 2D or 3D Point in the in the file <FileNum> in the layer <Layer>
! and in the color <Color> with coordenates (X,Y,Z).
!
! 
! Method: 
! No comment...
!
! Current Code Owner: 
! Carlos Otero & Davide Santos
! (Department of Civil Engineering of the University of Algarve - Portugal)     
! www.ualg.pt/est/adec/csc/dxfortran
! 
! History: 
! Version   Date     Comment 
! -------   -----    ------- 
!           01.06    Carlos Otero & Davide Santos
! 
!
! Code Description: 
!   Language:  Fortran 90. 
!   Software Standards: "European Standards for Writing and  
!     Documenting Exchangeable Fortran 90 Code". 
! 

Implicit None 
 
! Include statements: 
! Declarations must be of the form: 
 
! Subroutine arguments 
! Scalar arguments with intent(in): 

Real, Intent (in)        ::              &
                              X,         &     !+ Coordenate XX
                              Y,         &     !+ Coordenate YY
                              Z,         &     !+ Coordenate ZZ
							  Thick			   !+ Thickness of the Point

    
Integer   ,Intent (in)   ::   FileNum          !+ File number
                          
Character , Intent(in)   ::               &
                              Color *(*), &     !+ 3DFace Color
                              Layer *(*)        !+ 3DFace layer

!- End of header --------------------------------------------------------------- 
      write (FileNum,fmt='(A)')  "  0"          !+ Begin of 3DFace
      write (FileNum,fmt='(A)')  "POINT"        !
      write (FileNum,fmt='(A)')  "  8"          !+ Layer code
      write (FileNum,fmt='(A)')  TRIM(Layer)    !  Layer's name

      if (Color=="bylayer" .or. &                
          Color=="Bylayer" .or. &
          Color=="BYLAYER")  then
         ! Nothing to do if color is bylayer
      else
         write (FileNum,fmt='(A)')  " 62"        !+ Color code
         write (FileNum,fmt='(A)')  TRIM(Color)  !
      end if
      write (FileNum,fmt='(A)')  " 39"			 !+ Thickness of the Point
      write (FileNum,fmt= *    ) Thick			  ! 
      
      write (FileNum,fmt='(A)')  " 10"           !+ Point codes
      write (FileNum,fmt= *   )  X               ! 
      write (FileNum,fmt='(A)')  " 20"           !
      write (FileNum,fmt= *   )  Y               !
      write (FileNum,fmt='(A)')  " 30"           !
      write (FileNum,fmt= *   )  Z               !

 return
 end subroutine dfpoint
!
! Draw a SOLID in DXF format.
! 
Subroutine dfSolid    & 
          (FileNum,   &
           Layer,     &
           Ltype,     &
           Color,     &
           X1,        &
           Y1,        &
           X2,        &
           Y2,        &
           X3,        &
           Y3,        &
           X4,        &
           Y4,        &
           Z4,        &
           Thick)   
!
! Description: 
! 
! Draw a SOLID in the in the file <FileNum> in the layer <Layer>
! and in the color <Color> with coordenates <X1,Y1><X2,Y2><X3,Y3>
! <X4,Y4,Z4> and the thickness of the SOLID.
! 
! Node 1 - (X1, Y1)           1------2
! Node 2 - (X2, Y2)           |      |
! Node 3 - (X3, Y3)           |      |
! Node 4 - (X4, Y4, Z4)       3------4
!
! 
! Method: 
! No comment...
!
! Current Code Owner: 
! David A. B. Pereira
! (Department of Civil Engineering of the University of Algarve - Portugal)     
! 
! History: 
! Version     Date      Comment 
! -------   --------    ------- 
!           02.02.18    David A. B. Pereira
! 
!
! Code Description: 
!   Language:  Fortran 90. 
!   Software Standards: "European Standards for Writing and  
!     Documenting Exchangeable Fortran 90 Code". 
! 

Implicit None 
 
! Include statements: 
! Declarations must be of the form: 
 
! Subroutine arguments 
! Scalar arguments with intent(in): 

Real,Intent (in)         ::               &
                              X1,         &     !+ Coordenate XX - node 1
                              Y1,         &     !+ Coordenate YY
                              X2,         &     !+ Coordenate XX - node 2
                              Y2,         &     !+ Coordenate YY
                              X3,         &     !+ Coordenate XX - node 3
                              Y3,         &     !+ Coordenate YY
                              X4,         &     !+ Coordenate XX - node 4
                              Y4,         &     !+ Coordenate YY
                              Z4,         &     !+ Coordenate ZZ
                              Thick             !+ Thickness

    
Integer   ,Intent (in) ::     FileNum           !+ File number
                          
Character , Intent(in) ::                 &
                              Color *(*), &     !+ SOLID Color
                              Layer *(*), &     !+ SOLID layer
                              Ltype *(*)        !+ SOLID "LineType"

!- End of header --------------------------------------------------------------- 
      write (FileNum,fmt='(A)')  "  0"          !+ Begin of SOLID
      write (FileNum,fmt='(A)')  "SOLID"        !
      write (FileNum,fmt='(A)')  "  8"          !+ Layer code
      write (FileNum,fmt='(A)')  TRIM(Layer)    !  Layer's name
      write (FileNum,fmt='(A)')  "  6"          !+ LType code
      write (FileNum,fmt='(A)')  TRIM(Ltype)    !  LType name

      if (Color=="bylayer" .or. &                
          Color=="Bylayer" .or. &
          Color=="BYLAYER")  then
         ! Nothing to do if color is bylayer
      else
         write (FileNum,fmt='(A)')  " 62"        !+ Color code
         write (FileNum,fmt='(A)')  TRIM(Color)  !
      end if
      
      write (FileNum,fmt='(A)')  " 10"           !+ Begin of SOLID - Node 1
      write (FileNum,fmt= *   )  X1              ! 
      write (FileNum,fmt='(A)')  " 20"           !
      write (FileNum,fmt= *   )  Y1              !
      write (FileNum,fmt='(A)')  " 30"           !
      write (FileNum,fmt= *   )  Z4              !

      write (FileNum,fmt='(A)')  " 11"           !+ Begin of SOLID - Node 2
      write (FileNum,fmt= *   )  X2              ! 
      write (FileNum,fmt='(A)')  " 21"           !
      write (FileNum,fmt= *   )  Y2              !
      write (FileNum,fmt='(A)')  " 31"           !
      write (FileNum,fmt= *   )  Z4              !

      write (FileNum,fmt='(A)')  " 12"           !+ Begin of SOLID - Node 3
      write (FileNum,fmt= *   )  X3              ! 
      write (FileNum,fmt='(A)')  " 22"           !
      write (FileNum,fmt= *   )  Y3              !
      write (FileNum,fmt='(A)')  " 32"           !
      write (FileNum,fmt= *   )  Z4              !

      write (FileNum,fmt='(A)')  " 13"           !+ Begin of SOLID - Node 4
      write (FileNum,fmt= *   )  X4              ! 
      write (FileNum,fmt='(A)')  " 23"           !
      write (FileNum,fmt= *   )  Y4              !
      write (FileNum,fmt='(A)')  " 33"           !
      write (FileNum,fmt= *   )  Z4              !
       write (FileNum,fmt='(A)')  " 39"          !
      write (FileNum,fmt= *   )  Thick           !+ Thickness
       
 return
 end subroutine dfSolid


!
! Draw a Solid Box
!

Subroutine dfSSolidBox & 
          (FileNum,   &
           Layer,     &
           Ltype,     &
           Color,     &
           X1,        &
           Y1,        &
           Z1,        &
           H1,		  &
		    B,        &
			L)
           
! Description: 
! Draw a Solid Box giving the center point <X1, Y1, Z1>,
! the width <B>, the length <L> and the thickness of the box.
!
! Method: 
! No comment...
!
! Current Code Owner: 
! David Pereira
! (Department of Civil Engineering of the University of Algarve - Portugal)     
! 
! History: 
! Version   Date     Comment 
! -------   -----    ------- 
! 0.1       02.02    David Pereira
!
! Code Description: 
!   Language:  Fortran 90. 
!   Software Standards: "European Standards for Writing and  
!     Documenting Exchangeable Fortran 90 Code". 
! 

Implicit None 
 
! Include statements: 
! Declarations must be of the form: 
 
! Subroutine arguments 
! Scalar arguments with intent(in): 

Real,Intent (in)       ::         &
                              X1, &  !+ Coordenate XX of the 1st node
                              Y1, &  !+ Coordenate YY of the 1st node   
                              Z1, &  !+ Coordenate ZZ of the 1st node 
							  H1, &	 !+ THICKNESS
							   B, &  !+ WIDTH OF THE BOX
							   L     !+ LENGHT OF THE BOX

Integer   ,Intent (in) :: FileNum !+ File number
                          
Character , Intent(in) ::            &
                         Color *(*), &  !+ Line's Color
                         Layer *(*), &  !+ Line's layer
                         Ltype *(*)     !+ Line's "LineType"

REAL :: X(4),Y(4),Z(4)
INTEGER :: I

!+
!+ Definition of the Box corners
!+

X(1)=X1-0.50*B
X(2)=X1+0.50*B
X(3)=X(1)
X(4)=X(2)
Y(1)=Y1+0.50*L
Y(2)=Y(1)
Y(3)=Y1-0.50*L
Y(4)=Y(3)


CALL dfSolid(FileNum, Layer,Ltype,Color,X(1),Y(1),X(2),Y(2),X(3),Y(3),X(4),Y(4),Z1,H1)

  return
  end subroutine dfSSolidBox




End Module DXFortranStd

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -