upgraded packages
This commit is contained in:
parent
d42fe2b1f9
commit
f2211bf5f5
3 changed files with 353 additions and 256 deletions
|
|
@ -24,7 +24,7 @@ SOFTWARE.
|
|||
|
||||
use delaunator::{triangulate, Point as DelaunatorPoint};
|
||||
use geo::{Point as GeoPoint, Coord};
|
||||
use rand::Rng;
|
||||
use rand::RngExt;
|
||||
use rayon::prelude::*;
|
||||
use std::cmp::{min, max};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
|
@ -265,10 +265,10 @@ impl Xenobalanus {
|
|||
let max_x = center.0 + side_length / 2.0;
|
||||
let min_y = center.1 - side_length / 2.0;
|
||||
let max_y = center.1 + side_length / 2.0;
|
||||
let mut rng: rand::prelude::ThreadRng = rand::thread_rng();
|
||||
let mut rng = rand::rng();
|
||||
for _ in 0..num_points {
|
||||
let x = min_x + rng.gen_range(0.0..=1.0) as f32 * ( max_x - min_x);
|
||||
let y: f32 = min_y + rng.gen_range(0.0..=1.0) as f32 * ( max_y - min_y);
|
||||
let x = min_x + rng.random_range(0.0..=1.0) as f32 * ( max_x - min_x);
|
||||
let y: f32 = min_y + rng.random_range(0.0..=1.0) as f32 * ( max_y - min_y);
|
||||
self.points.push(Point {x, y});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue