.. Generování 3D modelu otisku prstu documentation master file, created by
   sphinx-quickstart on Fri May  5 21:01:20 2023.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Generating fingerprint models
=============================

Generating curved fingerprint model
-----------------------------------

It is possible to generate stl model using the `--stl` switch. This requires more parameters, first of which is the type of generated fingerprint.

If the mode is set to `c`, the output model will be a curved finger model, with optional parameters following the filename controlling its shape.

First optional parameter is papilar line height `height_line`, second is thickness of the model `height_base`,
third the rate of curvature along x axis `curv_rate_x` and the third is the rate of curvature along y axis `curv_rate_y`.

* General form for curved stl generation:

.. code-block:: console

    $ python3 src/main.py input_file output_file dpi --config config_file preset --stl c height_line height_base curvature_x curvature_y

* Working example curved stl generation:

.. code-block:: console

    $ python3 src/main.py res/examples/Palec_P4.tif res/examples/Palec_P4_from_preset.png 600 --config config/config.json git_example --stl c 2 10 2 2

Generating planar finger model
-----------------------------------

Using `p` mode makes the generated fingerprint model flat.
Optional parameters are height of the papilar lines and base thickness.

* General command form for planar stl generation:

.. code-block:: console

    $ python3 src/main.py input_file output_file dpi --config config_file preset --stl p height_line height_base

* Working example of planar stl generation:

.. code-block::

    $ python3 src/main.py res/examples/Palec_P4.tif res/examples/Palec_P4_from_preset.png 600 --config config/config.json git_example --stl p 2 10

Mapping fingerprint to existing finger model
--------------------------------------------


Using `m` mode modifies the preexisting finger model to contain fingerprint.
First optional parameter is papilar line height `height_line`, second is the number of iterations `iter` to make the finger mesh denser. Higher number of itertions results in denser finger mesh and better result.
The last three parameters are axis offsets for the finger, `finger_x`, `finger_y`, `finger_z`.
These control the location of the finger. They need to be set only if the user wants to move core of the print closer to the center of the finger.

* General command form for mapped stl generation

.. code-block:: console

    $ python3 src/main.py input_file output_file dpi --config config_file preset --stl m height_line iter finger_x finger_y finger_z

* Working example of finger mapping

.. code-block:: console

    $ python3 src/main.py res/examples/Palec_P4.tif res/examples/Palec_P4.png 600 --config conf/conf.json ridge --stl m 0.2 2 0 0 0


