Fortran code for reading and writing STL (STereoLithography) files.
program main
use,intrinsic :: iso_fortran_env, only: wp => real64
use stl_module
implicit none
type(stl_file) :: model
integer :: istat !! status return code
! add a sphere:
call model%add_sphere([0.0_wp, 0.0_wp, 0.0_wp], 1.0_wp, 20, 40)
call model%write_binary_stl_file('sphere.stl',istat)
end program main
A Fortran Package Manager manifest file is included, so that the library and test cases can be compiled with FPM. For example:
fpm build --profile release
fpm test --profile release
To use stl-fortran
within your fpm project, add the following to your fpm.toml
file:
[dependencies]
stl-fortran = { git="https://github.com/jacobwilliams/stl-fortran.git" }
To generate the documentation using FORD, run: ford stl-fortran.md
The stl-fortran source code and related files and documentation are distributed under a permissive free software license (BSD-style).
The latest API documentation can be found here. This was generated from the source code using FORD.