Skip to content

Commit

Permalink
Removing offset2 from Perl bindings and other minor cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
bubnikv committed May 6, 2021
1 parent 1c6333e commit f16d495
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 32 deletions.
2 changes: 1 addition & 1 deletion lib/Slic3r/Geometry/Clipper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(
offset offset2
offset
offset_ex offset2_ex
diff_ex diff union_ex intersection_ex
JT_ROUND JT_MITER JT_SQUARE
Expand Down
2 changes: 1 addition & 1 deletion lib/Slic3r/Print/Object.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use List::Util qw(min max sum first);
use Slic3r::Flow ':roles';
use Slic3r::Geometry qw(scale epsilon);
use Slic3r::Geometry::Clipper qw(diff diff_ex intersection intersection_ex union union_ex
offset offset2 offset_ex offset2_ex JT_MITER);
offset offset_ex offset2_ex JT_MITER);
use Slic3r::Print::State ':steps';
use Slic3r::Surface ':types';

Expand Down
3 changes: 1 addition & 2 deletions src/libslic3r/Geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1083,8 +1083,7 @@ MedialAxis::process_edge_neighbors(const VD::edge_type* edge, ThickPolyline* pol
}
}

bool
MedialAxis::validate_edge(const VD::edge_type* edge)
bool MedialAxis::validate_edge(const VD::edge_type* edge)
{
// prevent overflows and detect almost-infinite edges
#ifndef CLIPPERLIB_INT32
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/PNGReadWrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ bool decode_png(IStream &in_buf, ImageGreyscale &out_img)
// Down to earth function to store a packed RGB image to file. Mostly useful for debugging purposes.
// Based on https://www.lemoda.net/c/write-png/
// png_color_type is PNG_COLOR_TYPE_RGB or PNG_COLOR_TYPE_GRAY
//FIXME maybe better to use tdefl_write_image_to_png_file_in_memory() instead?
static bool write_rgb_or_gray_to_file(const char *file_name_utf8, size_t width, size_t height, int png_color_type, const uint8_t *data)
{
bool result = false;
Expand Down
16 changes: 0 additions & 16 deletions tests/libslic3r/test_elephant_foot_compensation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@ using namespace Slic3r;

namespace Slic3r {
ClipperLib::Path mittered_offset_path_scaled(const Points& contour, const std::vector<float>& deltas, double miter_limit);

#if 0
static Points mittered_offset_path_scaled_points(const Points& contour, const std::vector<float>& deltas, double miter_limit)
{
Points out;
ClipperLib::Path scaled = mittered_offset_path_scaled(contour, deltas, miter_limit);
for (ClipperLib::IntPoint& pt : scaled) {
pt.X += CLIPPER_OFFSET_SCALE_ROUNDING_DELTA;
pt.Y += CLIPPER_OFFSET_SCALE_ROUNDING_DELTA;
pt.X >>= CLIPPER_OFFSET_POWER_OF_2;
pt.Y >>= CLIPPER_OFFSET_POWER_OF_2;
out.emplace_back(coord_t(pt.x()), coord_t(pt.y()));
}
return out;
}
#endif
}

static ExPolygon spirograph_gear_1mm()
Expand Down
12 changes: 0 additions & 12 deletions xs/xsp/Clipper.xsp
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ offset_ex(polygons, delta, joinType = Slic3r::ClipperLib::jtMiter, miterLimit =
OUTPUT:
RETVAL

Polygons
offset2(polygons, delta1, delta2, joinType = Slic3r::ClipperLib::jtMiter, miterLimit = 3)
Polygons polygons
const float delta1
const float delta2
Slic3r::ClipperLib::JoinType joinType
double miterLimit
CODE:
RETVAL = offset2(polygons, delta1, delta2, joinType, miterLimit);
OUTPUT:
RETVAL

ExPolygons
offset2_ex(polygons, delta1, delta2, joinType = Slic3r::ClipperLib::jtMiter, miterLimit = 3)
Polygons polygons
Expand Down

0 comments on commit f16d495

Please sign in to comment.