gdritter repos axidraw-experiments / 7c43472
Adjust space-drawing for 23x30cm paper Getty Ritter 6 years ago
1 changed file(s) with 8 addition(s) and 5 deletion(s). Collapse all Expand all
66 use rand::Rng;
77
88 fn main() {
9 let (w, h) = (11.0, 14.0);
9 let cent = 0.393701;
10 let (w, h) = (23.0 * cent, 30.0 * cent);
1011 let mut drawing = gt::svg(w, h);
11 drawing.add(gt::rect((0.0, 0.0), (11.0, 14.0)));
12 drawing.add(gt::rect((0.0, 0.0), (w, h)));
1213
1314 let mut rng = rand::thread_rng();
1415 let per_inch = 5.0;
1516
1617 let mut points: HashSet<(usize, usize)> = iproduct!(
17 per_inch as usize .. per_inch as usize * 10,
18 per_inch as usize .. per_inch as usize * 13
18 per_inch as usize .. per_inch as usize * 8,
19 per_inch as usize .. per_inch as usize * 11
1920 ).collect();
2021 let mut src: Vec<(usize, usize)> = points.clone().into_iter().collect();
2122 rng.shuffle(&mut src);
5758 }
5859 }
5960
60 drawing.to_stdout();
61 if let Err(e) = drawing.output("space") {
62 eprintln!("{:?}", e);
63 }
6164 }