Skip to content

Commit

Permalink
Fix truncated octahedrons. #1646
Browse files Browse the repository at this point in the history
  • Loading branch information
alranel committed Aug 8, 2014
1 parent 534b8c3 commit 45fc748
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Slic3r/Fill/3DHoneycomb.pm
Expand Up @@ -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) {
Expand Down

0 comments on commit 45fc748

Please sign in to comment.