Return STL statistics.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(in) | :: | self | File STL. |
||
| character(len=*), | intent(in), | optional | :: | prefix | Lines prefix. |
STL statistics.
pure function statistics(self, prefix) result(stats)
!< Return STL statistics.
class(file_stl_object), intent(in) :: self !< File STL.
character(*), intent(in), optional :: prefix !< Lines prefix.
character(len=:), allocatable :: stats !< STL statistics.
character(len=:), allocatable :: prefix_ !< Lines prefix, local variable.
character(1), parameter :: NL=new_line('a') !< Line terminator.
prefix_ = '' ; if (present(prefix)) prefix_ = prefix
stats = prefix_//self%header//NL
if (allocated(self%file_name)) stats=stats//prefix_//'file name: '//self%file_name//NL
if (self%is_ascii) then
stats=stats//prefix_//'file format: ascii'//NL
else
stats=stats//prefix_//'file format: binary'//NL
endif
if (self%facets_number > 0) then
stats=stats//prefix_//'X extents: ['//trim(str(self%bmin%x))//', '//trim(str(self%bmax%x))//']'//NL
stats=stats//prefix_//'Y extents: ['//trim(str(self%bmin%y))//', '//trim(str(self%bmax%y))//']'//NL
stats=stats//prefix_//'Z extents: ['//trim(str(self%bmin%z))//', '//trim(str(self%bmax%z))//']'//NL
stats=stats//prefix_//'volume: '//trim(str(self%volume))//NL
stats=stats//prefix_//'number of facets: '//trim(str(self%facets_number))//NL
! stats=stats//prefix_//'number of facets with 1 edge disconnected: '//trim(str(self%facets_1disconnect_number))//NL
! stats=stats//prefix_//'number of facets with 2 edge disconnected: '//trim(str(self%facets_2disconnect_number))//NL
! stats=stats//prefix_//'number of facets with 3 edge disconnected: '//trim(str(self%facets_3disconnect_number))//NL
endif
endfunction statistics