<commit_before>//Copyright (c) 2022 <NAME>.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.

#include "PolygonConnector.h"

#include "linearAlg2D.h"
#include "AABB.h"

namespace cura 
{

PolygonConnector::PolygonConnector(const coord_t line_width)
: line_width(line_width - 5) // a bit less so that consecutive lines which have become connected can still connect to other lines
//                |                     |                      |
// ----------o    |      ----------o    |       ----------o,,,,o
//           |    |  ==>           |    |  ==>
// -----o    |    |      -----o----o    |       -----o----o----o
//      |    |    |                     |                      |
//      |    |    |           o''''o    |            o''''o    |
//      |    |    |           |    |    |            |    |    |
{}

void PolygonConnector::add(const Polygons& input)
{
    for (ConstPolygonRef poly : input)
    {
        input_polygons.push_back(poly);
    }
}

void PolygonConnector::add(const VariableWidthPaths& input)
{
    for(const VariableWidthLines& lines : input)
    {
        for(const ExtrusionLine& line : lines)
        {
            input_paths.push_back(line);
        }
    }
}

void PolygonConnector::connect(Polygons& output_polygons, VariableWidthPaths& output_paths)
{
    std::vector<Polygon> result_polygons = connectGroup(input_polygons);
    for(Polygon& polygon : result_polygons)
    {
        output_polygons.add(polygon);
    }<commit_msg>Remove -5 line width weirdness<commit_after>//Copyright (c) 2022 <NAME>.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.

#include "PolygonConnector.h"

#include "linearAlg2D.h"
#include "AABB.h"

namespace cura 
{

PolygonConnector::PolygonConnector(const coord_t line_width)
: line_width(line_width)
{}

void PolygonConnector::add(const Polygons& input)
{
    for (ConstPolygonRef poly : input)
    {
        input_polygons.push_back(poly);
    }
}

void PolygonConnector::add(const VariableWidthPaths& input)
{
    for(const VariableWidthLines& lines : input)
    {
        for(const ExtrusionLine& line : lines)
        {
            input_paths.push_back(line);
        }
    }
}

void PolygonConnector::connect(Polygons& output_polygons, VariableWidthPaths& output_paths)
{
    std::vector<Polygon> result_polygons = connectGroup(input_polygons);
    for(Polygon& polygon : result_polygons)
    {
        output_polygons.add(polygon);
    }
{'fraction_non_alphanumeric': 0.1326821326821327, 'fraction_numerical': 0.005698005698005698, 'mean_word_length': 2.107458912768647, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '947050', 'n_tokens_mistral': 803, 'n_tokens_neox': 794, 'n_words': 152}