Disable arc compensation code
This commit is contained in:
parent
44c636aea1
commit
ac08cf7469
@ -221,24 +221,26 @@ sub make_perimeters {
|
|||||||
my $distance = 0;
|
my $distance = 0;
|
||||||
|
|
||||||
# experimental hole compensation (see ArcCompensation in the RepRap wiki)
|
# experimental hole compensation (see ArcCompensation in the RepRap wiki)
|
||||||
foreach my $hole ($last_offsets[0]->holes) {
|
if (0) {
|
||||||
my $circumference = abs($hole->length);
|
foreach my $hole ($last_offsets[0]->holes) {
|
||||||
next unless $circumference <= $Slic3r::small_perimeter_length;
|
my $circumference = abs($hole->length);
|
||||||
# this compensation only works for circular holes, while it would
|
next unless $circumference <= $Slic3r::small_perimeter_length;
|
||||||
# overcompensate for hexagons and other shapes having straight edges.
|
# this compensation only works for circular holes, while it would
|
||||||
# so we require a minimum number of vertices.
|
# overcompensate for hexagons and other shapes having straight edges.
|
||||||
next unless $circumference / @$hole >= scale 3 * $Slic3r::flow->width;
|
# so we require a minimum number of vertices.
|
||||||
|
next unless $circumference / @$hole >= scale 3 * $Slic3r::flow->width;
|
||||||
# revert the compensation done in make_surfaces() and get the actual radius
|
|
||||||
# of the hole
|
# revert the compensation done in make_surfaces() and get the actual radius
|
||||||
my $radius = ($circumference / PI / 2) - scale $self->perimeters_flow->spacing/2;
|
# of the hole
|
||||||
my $new_radius = (scale($self->perimeters_flow->width) + sqrt((scale($self->perimeters_flow->width)**2) + (4*($radius**2)))) / 2;
|
my $radius = ($circumference / PI / 2) - scale $self->perimeters_flow->spacing/2;
|
||||||
# holes are always turned to contours, so reverse point order before and after
|
my $new_radius = (scale($self->perimeters_flow->width) + sqrt((scale($self->perimeters_flow->width)**2) + (4*($radius**2)))) / 2;
|
||||||
$hole->reverse;
|
# holes are always turned to contours, so reverse point order before and after
|
||||||
my @offsetted = $hole->offset(+ ($new_radius - $radius));
|
$hole->reverse;
|
||||||
# skip arc compensation when hole is not round (thus leads to multiple offsets)
|
my @offsetted = $hole->offset(+ ($new_radius - $radius));
|
||||||
@$hole = map Slic3r::Point->new($_), @{ $offsetted[0] } if @offsetted == 1;
|
# skip arc compensation when hole is not round (thus leads to multiple offsets)
|
||||||
$hole->reverse;
|
@$hole = map Slic3r::Point->new($_), @{ $offsetted[0] } if @offsetted == 1;
|
||||||
|
$hole->reverse;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my @gaps = ();
|
my @gaps = ();
|
||||||
|
Loading…
Reference in New Issue
Block a user