(
width: usize,
height: usize,
size_x: f64,
size_y: f64,
grid_type: GridType,
)
| 121 | } |
| 122 | |
| 123 | fn grid( |
| 124 | width: usize, |
| 125 | height: usize, |
| 126 | size_x: f64, |
| 127 | size_y: f64, |
| 128 | grid_type: GridType, |
| 129 | ) -> GeometryGraph<Undirected> { |
| 130 | if width == 0 || height == 0 { |
| 131 | return GeometryGraph::<Undirected>::default(); |
| 132 | } |
| 133 | |
| 134 | match grid_type { |
| 135 | GridType::Triangle => tri_grid(width, height, size_x, size_y), |
| 136 | GridType::Quad => quad_grid(width, height, size_x, size_y), |
| 137 | GridType::Ragged => ragged_grid(width, height, size_x, size_y), |
| 138 | GridType::Hexagon => hex_grid(width, height, size_x, size_y), |
| 139 | GridType::Radial => unreachable!("Radial grid types are implemented differently"), |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | fn tri_i2x(i: usize, size_x: f64, odd: bool) -> f64 { |
| 144 | let mut x = (i as f64) * size_x; |
no test coverage detected