Skip to content

Feature map ​

Everything FOSSIL does, grouped as the reference is grouped. Each row names the entry point, the reference page and, where there is one, the tutorial chapter that uses it. Every public operation is a type-bound procedure of one of four types, surface_stl_object, curve_object, distance_field_object and facet_object, or a free procedure of a module of its own (named in the row); use fossil re-exports the types and the named constants.

Surfaces ​

CapabilityEntry pointReferenceTutorialCookbook
Load ASCII or binary STL, format detected, NaN/Inf rejected, optional clip boxsurface%load_from_fileI/O, analysis, manipulation11, 2, 3, 4
Save ASCII or binary STLsurface%save_into_fileI/O, analysis, manipulation11
Bounding box, volume, centroid, connectivity, shells and bodies, pseudo-normals, AABB treesurface%analyze (run by load, sanitize, clip)I/O, analysis, manipulation11
Validity: watertight, manifold, closed volumeis_watertight, is_manifold, is_volumeI/O, analysis, manipulation21
Repair: slivers, duplicates, gaps, orientation, one warning per defect classsurface%sanitizeI/O, analysis, manipulation21
Hole filling (Liepa minimum-weight patches, refinement, thin-plate fairing)surface%fill_holesHole filling21
Translate, rotate, mirror, resize, clip, mergetranslate, rotate, mirror, resize, clip, merge_solidsI/O, analysis, manipulation31, 2, 3
Self-intersection detection and resolution (exact pair_cut, exact predicates)find_self_intersections, resolve_self_intersectionsSelf-intersection121, 2
Booleans: union, intersection, difference, symmetric difference (Zhou et al. 2016)surface%booleanBoolean operations121
Quadric decimation (Garland and Heckbert 1997)surface%decimateMesh decimation1, 2
Isotropic remeshing, optional feature preservation (Botsch and Kobbelt 2004)surface%isotropic_remeshIsotropic remeshing121
Explicit and Taubin smoothingsurface%smoothMesh smoothing1
Alpha wrapping: a watertight surrogate of any triangle soup (Portaneri et al. 2022)surface%alpha_wrapAlpha wrapping1
Isosurface extraction (Lorensen and Cline 1987)extract_isosurfaceMarching cubes1
Shape-diameter segmentation (Shapira et al. 2008)surface%segment_sdfSDF segmentation1
Cotangent Laplacian and barycentric masssurface%cotangent_laplacianCotangent Laplacian1
Gaussian and mean curvature per vertex; pointwise O(h²) by a cubic jet fitgaussian_curvature, mean_curvature, jet_curvaturePer-vertex curvature1, 2
Mass, centre of mass, inertia tensor, principal axes (exact polyhedral integrals); 2-D second momentssurface%mass_properties, curve%mass_properties, inertia_to_world, principal_frameMass properties121, 2, 3
Surface deviation: one-sided and symmetric Hausdorff distance, mean, rms, per-vertex distancesurface%deviation, surface%hausdorff, curve%deviation, curve%hausdorffSurface deviation121, 2
Feature edges: sharp, boundary and non-manifold edges, corners, polylines; refinement and distances along them; 2-D cornerssurface%feature_edges, build_features, box_feature_many, tag_block(feature_tags=), query_many(feature_distances=), curve%feature_cornersFeature edges121, 2, 3
Local thickness and gaps per facet: ray (shape diameter) and medial (shrinking ball); thin regions under a cell size; refinement of thin wallssurface%thickness, thin_regions, build_thin, box_thin_many, tag_block(thin_tags=), curve%thicknessThickness and gaps121, 2
Named patches: one per solid block or per file, kept on every facet; multi-solid ASCII outputload_from_files, get_patches_number, patch_name, facet_patch, set_patchNamed patches121, 2
Distance between two bodies: closest facets and points, contact; bit-identical to brute forcesurface%distance_toBody–body distance141
Time of first contact of moving bodies over a step: certified (never late, no tunnelling), several bodies, 2-D twinssurface%time_of_impact, curve%time_of_impact, first_impact, first_impact_2dContinuous collision detection141, 2

Distance and signs ​

CapabilityEntry pointReferenceTutorialCookbook
Signed or unsigned distance of a point, bit-exact against brute forcesurface%distanceI/O, analysis, manipulation41
Closest facet, edge, vertex, point and normalsurface%compute_distanceI/O, analysis, manipulation41
Inside or outsidesurface%is_point_insideSign algorithms benchmark41
Four sign algorithms: pseudo-normal (default), ray parity, solid angle, fast winding numbersign_algorithm=Sign algorithms benchmark41
Generalized and fast winding number (Jacobson 2013, Barill 2018)surface%winding_numberWinding number1
Batched distances, OpenMP-parallel and bit-exact with serialsurface%distance_manyI/O, analysis, manipulation51
SAH BVH (default) or octree accelerationaabb_tree_kind=I/O, analysis, manipulation51
Read-only access to the acceleration tree: node boxes down to a depth, leaves and their facets (both kinds; curve twin)surface%tree_boxes, curve%tree_boxesI/O, analysis, manipulation51
Ray queries: first hit, all hits (one per crossing, exact), any hitintersect_ray_first, _all, _anyRay queries1
Signed-distance field on a stretched grid: exact band, flood-fill signs, fast sweepingdistance_field_object%computeSigned-distance fields61
Eikonal diagnostic of a fielddistance_field_object%gradient_diagnosticSigned-distance fields1

Immersed boundaries ​

CapabilityEntry pointReferenceTutorialCookbook
2-D curves: closed and open polylines, segment BVH, signed distance, 2-D winding number, repaircurve_object2-D geometry71
Axis-aligned section of an STL as a curveslice_surface2-D geometry71
Rich queries: closest point, feature, pseudo-normal, body; ambiguous feet; wall curvaturequery_point, query_manyImmersed-boundary queries81, 2
Image points and probes with a visibility testimage_points, probe_manyImmersed-boundary queries81
Wall distance with body id and early cutoffwall_distance_manyImmersed-boundary queries1
Grid-adapted markerssurface_markers, curve_markersImmersed-boundary queries1, 2
AMR block and cell classification: cut, near, inside, outsidebox_classify_manyAMR tagging91
Signed tag bands on a blocktag_blockAMR tagging91
Exact grid-line crossings and wall fractionsline_crossings, cell_wall_fractionsCut-cell geometry1, 2
2-D cut cells: fractions, apertures, centroids, wetted boundary, piecescurve%cut_cellsCut-cell geometry101, 2
3-D cut cells: face fractions, volumes, fluid pieces with their own measurescut_cells_3d (module fossil_cut_cells_3d)Cut-cell geometry101
Cut-cell solver support: piece links, state- and flux-redistribution neighbourhoods, merge targetscut_links_2d, cut_cells_3d(links=), srd_neighbourhoods, frd_neighbourhoods, merge_targetsCut cells: solver support1, 2
Cut-cell moments up to order 4, quadrature rules, edge fractions, exact coarseningcut_cells_3d(moments_order=, quadrature=, edges=), curve%cut_cells(moments_order=, quadrature=), cut_coarsen_3d, cut_coarsen_2dCut cells: solver support1, 2, 3
Curvilinear structured blocks: topology records (seams, cuts, poles, periodic, interfaces) and their detectioncurvilinear_block_t, curvilinear_block_2d_t, detect_topologyCurvilinear blocks131, 2
Exact cell geometry, certified cell validity, quality metricsgeometry, validity, qualityCurvilinear blocks131
Point location in curvilinear blocks (robust, walking, GPU) and Lagrange stencils of width qlocate_many, locate_many_device, locate_in_blocks, stencilsCurvilinear blocks131, 2, 3
Overset cutters and hole cutting: wall cutters with trimming, exact hole flags (CPU and GPU), hole maps, X-rayswall_cutter, hole_flags, hole_map, xray_flagsOverset assembly131, 2
Overset donors and classification: candidates with quality (CPU and GPU), pair matrix, explicit and implicit selection, fringes, orphans by cause, overlap width, wall projection, moving grids, connectivity outputdonor_candidates, classify, fringe_levels, wall_projection, exposed_points, build_connectivityOverset assembly131, 2, 3, 4, 5
Body-fitted grid support: constrained projection onto bodies (patches, feature and patch-boundary curves, corners), block faces, wall-spacing and quality report (y1, y1+, growth), 2-D hyperbolic extrusionprojection_target, project_points, project_block_face, block_report, hyperbolic_grid_2dBody-fitted grid support151, 2, 3, 4, 5
Rigid poses, body-frame queries, O(N) tree refitrigid_pose_t, pose=, moveMoving bodies111
Swept geometry of a time step: exact swept volumes, time-averaged aperturesswept_cells_2d, swept_cells_3dMoving bodies111, 2

GPU ​

CapabilityEntry pointReferenceTutorialCookbook
Distance, rich queries, wall distance, box classification, posed queries on the device (OpenACC), bit-exact against the CPU pathenter_device, *_device, exit_deviceGPU queries161, 2

fossilizer CLI ​

src/app/fossilizer.f90 wraps the library for the command line: load one or more STL files, clip, merge, mirror, rotate, translate, resize, sanitize and repair connectivity, print statistics and, with --mass_properties [--density ρ], the mass properties of a closed body, or with --compare other.stl, the certified Hausdorff distance to another surface, or with --distance other.stl, the body–body distance, or with --patches prefix, the named patches (one STL per patch), or with --features file.vtk, the feature edges and corners, or with --thickness file.vtk [--thickness_method ray|medial] [--h h --thin_factor f], the thinnest wall, the narrowest gap and the facets thinner than the cell; save the result.

Compilers ​

CompilerStatus
GNU gfortran 14.3+ (14 series) or ≥ 15.1Supported (13.x and 14.0–14.2 untested, see Installation)
Intel Fortran ≥ 16.xSupported
NVIDIA HPC Fortran (nvfortran) ≥ 26.9The device build of the GPU queries, compiled without FMA contraction

Design principles ​

  • Pure Fortran: no C extensions, no system calls beyond standard I/O.
  • Exact where it decides: orientation predicates are exact (orient2d, orient3d); tree-accelerated queries equal brute force bit for bit; the GPU path equals the CPU path bit for bit.
  • OOP and TDD: every operation is a type-bound procedure, every public operation is exercised by a test in src/tests/.
  • Free and open source: multi-licensed for FOSS and commercial use.