Streamline placement algorithms for matplotlib compatibility
Implements matplotlib's approach: - StreamMask for collision detection (30x30 base grid scaled by density) - Spiral seed point generation starting from boundaries - Coordinate system mapping between data, grid, and mask coordinates
Following SOLID principles with single responsibility for placement logic StreamMask for collision detection - equivalent to matplotlib's StreamMask Coordinate mapper for data ↔ grid ↔ mask transformations
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | nx | Mask dimensions | |||
| integer, | public | :: | ny | Mask dimensions | |||
| integer, | public, | allocatable | :: | mask(:,:) | Collision mask (0=free, 1=occupied) | ||
| integer, | public, | allocatable | :: | trajectory(:,:) | Current trajectory points for undo | ||
| integer, | public | :: | traj_length | = | 0 | Length of current trajectory | |
| integer, | public | :: | current_x | = | -1 | Current position | |
| integer, | public | :: | current_y | = | -1 | Current position | 
| procedure, public :: initialize => mask_initialize | |
| procedure, public :: is_free => mask_is_free | |
| procedure, public :: start_trajectory => mask_start_trajectory | |
| procedure, public :: update_trajectory => mask_update_trajectory | |
| procedure, public :: try_update_trajectory => mask_try_update_trajectory | |
| procedure, public :: undo_trajectory => mask_undo_trajectory | 
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public | :: | x_min | Data bounds | |||
| real(kind=wp), | public | :: | x_max | Data bounds | |||
| real(kind=wp), | public | :: | y_min | Data bounds | |||
| real(kind=wp), | public | :: | y_max | Data bounds | |||
| integer, | public | :: | grid_nx | Grid dimensions | |||
| integer, | public | :: | grid_ny | Grid dimensions | |||
| integer, | public | :: | mask_nx | Mask dimensions | |||
| integer, | public | :: | mask_ny | Mask dimensions | |||
| real(kind=wp), | public | :: | x_grid2mask | Grid to mask scaling | |||
| real(kind=wp), | public | :: | y_grid2mask | Grid to mask scaling | |||
| real(kind=wp), | public | :: | x_mask2grid | Mask to grid scaling | |||
| real(kind=wp), | public | :: | y_mask2grid | Mask to grid scaling | |||
| real(kind=wp), | public | :: | x_data2grid | Data to grid scaling | |||
| real(kind=wp), | public | :: | y_data2grid | Data to grid scaling | 
| procedure, public :: initialize => mapper_initialize | |
| procedure, public :: data2grid => mapper_data2grid | |
| procedure, public :: grid2data => mapper_grid2data | |
| procedure, public :: mask2grid => mapper_mask2grid | |
| procedure, public :: grid2mask => mapper_grid2mask | 
Generate seed points in spiral pattern starting from boundary Implements matplotlib's _gen_starting_points algorithm
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | mask_shape(2) | |||
| integer, | intent(out), | allocatable | :: | seed_points(:,:) | ||
| integer, | intent(out) | :: | n_seeds |