This project provides a C++ code for converting STL files into level set distributions stored in orthogonal grids. The level set distribution, calculated using Signed Distance Fields (SDF), represents the distance from a geometric surface. The resulting data can be utilized for various applications such as computational fluid dynamics (CFD), computer-aided design (CAD), and medical image processing.
-
Clone the repository:
git clone https://github.com/username/repository.git
-
Build using CMake:
cmake -S . -B build cmake --build build
-
Configuration:
Modify the
config.txt
file to specify the input STL file path, output CSV file name, output VTK file path, bounds factor, grid resolution, axis, thickness parameter, output VTK flag, and number of threads. -
Execution:
Run the compiled executable:
./build/src/STLToPorosity
The output CSV file containing cell dimensions and scalar values will be generated. If the
outputVtk
option is set to true, an additional VTK file will be created.