Commits

Trammell Hudson committed 9b37912 Draft

Separate x and y sizes

Comments (0)

Files changed (1)

 use Math::Geometry::Voronoi;
 use Math::Clipper;
 
-my $size = 200;
-my $num = 150;
+my $xsize = 200;
+my $ysize = 300;
+my $num = 240;
 my $line_width = 2;
 
 my @points = map { [
-	(rand $size*1.1) - $size*.05,
-	(rand $size*1.1) - $size*.05,
+	(rand $xsize*1.1) - $xsize*.05,
+	(rand $ysize*1.1) - $ysize*.05,
 ] } 0..$num;
 
 my $geo = Math::Geometry::Voronoi->new(points => \@points);
 # Clip it by the bounding box
 my $bounding = [
 	[0,0],
-	[$size,0],
-	[$size,$size],
-	[0,$size],
+	[$xsize,0],
+	[$xsize,$ysize],
+	[0,$ysize],
 ];
 
 my $clipper = Math::Clipper->new;