Fixed inner offset in the avoid crossing perimeters.
Minimum contour width was used incorrectly, which could lead to breaking contour to more disconnected polygons.
This commit is contained in:
parent
e123dfa8a4
commit
dc576b0511
@ -729,10 +729,11 @@ static std::vector<float> contour_distance(const EdgeGrid::Grid &grid,
|
|||||||
|
|
||||||
// Polygon offset which ensures that if a polygon breaks up into several separate parts, the original polygon will be used in these places.
|
// Polygon offset which ensures that if a polygon breaks up into several separate parts, the original polygon will be used in these places.
|
||||||
// ExPolygons are handled one by one so returned ExPolygons could intersect.
|
// ExPolygons are handled one by one so returned ExPolygons could intersect.
|
||||||
static ExPolygons inner_offset(const ExPolygons &ex_polygons, double offset, double min_contour_width = scale_(0.001))
|
static ExPolygons inner_offset(const ExPolygons &ex_polygons, double offset)
|
||||||
{
|
{
|
||||||
double search_radius = 2. * (offset + min_contour_width);
|
double min_contour_width = 2. * offset + SCALED_EPSILON;
|
||||||
ExPolygons ex_poly_result = ex_polygons;
|
double search_radius = 2. * (offset + min_contour_width);
|
||||||
|
ExPolygons ex_poly_result = ex_polygons;
|
||||||
resample_expolygons(ex_poly_result, offset / 2);
|
resample_expolygons(ex_poly_result, offset / 2);
|
||||||
|
|
||||||
for (ExPolygon &ex_poly : ex_poly_result) {
|
for (ExPolygon &ex_poly : ex_poly_result) {
|
||||||
|
Loading…
Reference in New Issue
Block a user