FOSSIL, FOrtran Stereo (si) Litography parser

Find us on…

GitHub

FOSSIL

FOSSIL GitHub tag

License License License License

Status Build Status Coverage Status

FOSSIL, FOrtran Stereo (si) Litography parser

  • FOSSIL is a pure Fortran (KISS) library for IO and manipulation of STL (Stereo Litography) files for modern (2003+) Fortran projects;
  • FOSSIL is Fortran 2003+ standard compliant;
  • FOSSIL is OOP designed;
  • FOSSIL is TDD designed;
  • FOSSIL is a Free, Open Source Project.

Issues

GitHub issues Ready in backlog In Progress Open bugs

Compiler Support

Compiler Compiler Compiler Compiler Compiler Compiler


What is FOSSIL? | Main features | Copyrights | Documentation | A Taste of FOSSIL


What is FOSSIL?

FOSSIL is a pure Fortran (KISS) library for IO and manipulation of STL (Stereo Litography) files for modern (2003+) Fortran projects.

FOSSIL provides a simple API to IO STL files and also to manipulate the triangulated surface contained into the STL file.

dragon

the dragon STL test (src/tests/dragon.stl) is composed by 6588 triangular facets. The signed distance computation on a uniform grid of 64^3 is accelerated by a factor of 7x using AABB algorithm with respect the simple brute force.

Go to Top

Main features

  • User-friendly methods for IO STL files:
    • input:
      • automatic guessing of file format (ASCII or BINARY);
      • load STL file effortless;
    • output:
      • save STL file effortless;
  • powerful surface analysis and manipulation:
    • build facets connectivity;
    • sanitize normals:
      • reverse normals:
      • make normals consistent:
    • compute volume;
    • rotate facets;
    • translate facets;
    • mirror facets;
    • resize (scale) facets;
    • compute minimal distance:
      • square distance;
      • square root distance;
      • signed distance:
        • by means of solid angle computation;
        • by means of rays intersection count;
      • AABB (Axis-Aligned Bounding Box) tree acceleration with user defined refinement levels;
    • point-in-polyhedra test:
      • by means of solid angle computation;
      • by means of rays intersection count;
    • fill holes;
    • check surface watertight;
  • errors trapping mechanism.

Any feature request is welcome.

Go to Top

Copyrights

FOSSIL is an open source project, it is distributed under a multi-licensing system:

Anyone is interest to use, to develop or to contribute to FOSSIL is welcome, feel free to select the license that best matches your soul!

More details can be found on wiki.

Go to Top

Documentation

Besides this README file the FOSSIL documentation is contained into its own wiki. Detailed documentation of the API is contained into the GitHub Pages that can also be created locally by means of ford tool.

A Taste of FOSSIL

FOSSIL is an KISS library:

simple load

effortless load of file (with STL surface analysis)

use fossil
type(file_stl_object) :: file_stl ! STL file handler.
call file_stl%initialize(file_name='cube.stl')
call file_stl%load_from_file(guess_format=.true.)

print main informations of STL

print '(A)', file_stl%statistics()

upon exection will print something like

Mesh_1
file name:   src/tests/cube.stl
file format: ascii
X extents: [ 0.000000000000000E+000, +0.100000000000000E+001]
Y extents: [ 0.000000000000000E+000, +0.100000000000000E+001]
Z extents: [ 0.000000000000000E+000, +0.100000000000000E+001]
volume: -0.100000000000000E+001
number of facets: +12

sanitiza normals

make normals consistent

call file_stl%sanitize_normals

simple manipulations

simply manipulate geometry

call file_stl%resize(factor=3.4*ex + 2*ey + 0.5*ez) ! ex, ey, ez being axis versors
call file_stl%resize(x=0.5, z=1.2)                  ! scale only x and z axis
call file_stl%mirror(normal=ex)                     ! mirror respect yz-plane
call file_stl%mirror(normal=ex+ey)                  ! mirror respect plane with normal ex+ey
call file_stl%mirror(matrix=matrix)                 ! mirror by a given mirroring matrix
call file_stl%rotate(axis=ex, angle=1.57)           ! rotate around x axis by pi/2
call file_stl%rotate(matrix=matrix)                 ! rotati by a given rotating matrix
call file_stl%translate(delta=3*ex + 2*ey + 0.5*ez) ! translate by a vectorial delta
call file_stl%translate(x=0.5, z=1.2)               ! translate by only x and z delta

Go to Top

Developer Info

Stefano Zaghi