Fix truncated octahedrons. #1646

This commit is contained in:
Alessandro Ranellucci 2014-08-08 13:28:24 +02:00
parent 534b8c3f12
commit 45fc748011

View File

@ -186,12 +186,11 @@ sub makeNormalisedGrid {
my ($z, $gridWidth, $gridHeight, $curveType) = @_;
## offset required to create a regular octagram
my $octagramGap = 1 / (1 + sqrt(2));
# my $octagramGap = 1;
my $octagramGap = 3/4;
# sawtooth wave function for range f($z) = [-$octagramGap .. $octagramGap]
my $offset = (abs((fmod($z * sqrt(2), 4)) - 2) - 1) * $octagramGap;
my $wave = abs(fmod($z, 2) - 1)*2 - 1;
my $offset = $wave * $octagramGap;
my @points = ();
if (($curveType & 1) != 0) {