Removing offset2 from Perl bindings and other minor cleanup.

This commit is contained in:
Vojtech Bubnik 2021-05-06 14:29:20 +02:00
parent 1c6333e557
commit f16d4953be
6 changed files with 4 additions and 32 deletions

View File

@ -5,7 +5,7 @@ use warnings;
require Exporter; require Exporter;
our @ISA = qw(Exporter); our @ISA = qw(Exporter);
our @EXPORT_OK = qw( our @EXPORT_OK = qw(
offset offset2 offset
offset_ex offset2_ex offset_ex offset2_ex
diff_ex diff union_ex intersection_ex diff_ex diff union_ex intersection_ex
JT_ROUND JT_MITER JT_SQUARE JT_ROUND JT_MITER JT_SQUARE

View File

@ -7,7 +7,7 @@ use List::Util qw(min max sum first);
use Slic3r::Flow ':roles'; use Slic3r::Flow ':roles';
use Slic3r::Geometry qw(scale epsilon); use Slic3r::Geometry qw(scale epsilon);
use Slic3r::Geometry::Clipper qw(diff diff_ex intersection intersection_ex union union_ex 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::Print::State ':steps';
use Slic3r::Surface ':types'; use Slic3r::Surface ':types';

View File

@ -1083,8 +1083,7 @@ MedialAxis::process_edge_neighbors(const VD::edge_type* edge, ThickPolyline* pol
} }
} }
bool bool MedialAxis::validate_edge(const VD::edge_type* edge)
MedialAxis::validate_edge(const VD::edge_type* edge)
{ {
// prevent overflows and detect almost-infinite edges // prevent overflows and detect almost-infinite edges
#ifndef CLIPPERLIB_INT32 #ifndef CLIPPERLIB_INT32

View File

@ -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. // 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/ // Based on https://www.lemoda.net/c/write-png/
// png_color_type is PNG_COLOR_TYPE_RGB or PNG_COLOR_TYPE_GRAY // 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) 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; bool result = false;

View File

@ -15,22 +15,6 @@ using namespace Slic3r;
namespace Slic3r { namespace Slic3r {
ClipperLib::Path mittered_offset_path_scaled(const Points& contour, const std::vector<float>& deltas, double miter_limit); 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() static ExPolygon spirograph_gear_1mm()

View File

@ -41,18 +41,6 @@ offset_ex(polygons, delta, joinType = Slic3r::ClipperLib::jtMiter, miterLimit =
OUTPUT: OUTPUT:
RETVAL 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 ExPolygons
offset2_ex(polygons, delta1, delta2, joinType = Slic3r::ClipperLib::jtMiter, miterLimit = 3) offset2_ex(polygons, delta1, delta2, joinType = Slic3r::ClipperLib::jtMiter, miterLimit = 3)
Polygons polygons Polygons polygons