mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-11 19:59:01 +08:00
Bugfix: 3D honeycomb infill wasn't correctly aligned among skewed layers. #2194
This commit is contained in:
parent
d5eb6b7be0
commit
2d0b27abed
@ -24,6 +24,16 @@ sub fill_surface {
|
|||||||
|
|
||||||
my $distance = $flow->scaled_spacing / $params{density};
|
my $distance = $flow->scaled_spacing / $params{density};
|
||||||
|
|
||||||
|
# align bounding box to a multiple of our honeycomb grid
|
||||||
|
{
|
||||||
|
my $min = $bb->min_point;
|
||||||
|
$min->translate(
|
||||||
|
-($bb->x_min % $distance),
|
||||||
|
-($bb->y_min % $distance),
|
||||||
|
);
|
||||||
|
$bb->merge_point($min);
|
||||||
|
}
|
||||||
|
|
||||||
# generate pattern
|
# generate pattern
|
||||||
my @polylines = map Slic3r::Polyline->new(@$_),
|
my @polylines = map Slic3r::Polyline->new(@$_),
|
||||||
makeGrid(
|
makeGrid(
|
||||||
@ -176,9 +186,9 @@ sub makeNormalisedGrid {
|
|||||||
my ($z, $gridWidth, $gridHeight, $curveType) = @_;
|
my ($z, $gridWidth, $gridHeight, $curveType) = @_;
|
||||||
|
|
||||||
## offset required to create a regular octagram
|
## offset required to create a regular octagram
|
||||||
## my $octagramGap = 1 / (1 + sqrt(2));
|
my $octagramGap = 1 / (1 + sqrt(2));
|
||||||
|
|
||||||
my $octagramGap = 1;
|
# my $octagramGap = 1;
|
||||||
|
|
||||||
# sawtooth wave function for range f($z) = [-$octagramGap .. $octagramGap]
|
# sawtooth wave function for range f($z) = [-$octagramGap .. $octagramGap]
|
||||||
my $offset = (abs((fmod($z * sqrt(2), 4)) - 2) - 1) * $octagramGap;
|
my $offset = (abs((fmod($z * sqrt(2), 4)) - 2) - 1) * $octagramGap;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user