<commit_before>#ifndef BUILDERS_BUILDINGS_FACADES_FLATFACADEBUILDER_HPP_DEFINED
#define BUILDERS_BUILDINGS_FACADES_FLATFACADEBUILDER_HPP_DEFINED

#include "builders/buildings/facades/FacadeBuilder.hpp"
#include "meshing/MeshBuilder.hpp"

namespace utymap { namespace builders {

// Responsible for building facade wall in low poly quality.
class FlatFacadeBuilder : public FacadeBuilder
{
public:
    FlatFacadeBuilder(const utymap::builders::BuilderContext& builderContext,
                       utymap::builders::MeshContext& meshContext)
        : FacadeBuilder(builderContext, meshContext)
    {
    }

  void build(utymap::meshing::Polygon& polygon)
  {
    utymap::meshing::MeshBuilder::Options options(
        0, // area
        0, // ele noise
        colorNoiseFreq_,
        height_,
        getColorGradient(),
        minHeight_
    );

    std::int64_t last = polygon.points.size() - 2;
    for (auto i = last; i >= 0; i -=2) {
      utymap::meshing::Vector2 p1(polygon.points[i + 1], polygon.points[i]);
      int j = i == 0 ? last : i - 2;
      utymap::meshing::Vector2 p2(polygon.points[j + 1], polygon.points[j]);

      builderContext_.meshBuilder.addPlane(meshContext_.mesh,
                                           p1,
                                           p2,
                                           minHeight_,
                                           minHeight_,
                                           options);
    }
  }
};

}}

#endif // BUILDERS_BUILDINGS_FACADES_FLATFACADEBUILDER_HPP_DEFINED<commit_msg>core: fix facade building issue<commit_after>#ifndef BUILDERS_BUILDINGS_FACADES_FLATFACADEBUILDER_HPP_DEFINED
#define BUILDERS_BUILDINGS_FACADES_FLATFACADEBUILDER_HPP_DEFINED

#include "builders/buildings/facades/FacadeBuilder.hpp"
#include "meshing/MeshBuilder.hpp"

namespace utymap { namespace builders {

// Responsible for building facade wall in low poly quality.
class FlatFacadeBuilder : public FacadeBuilder
{
public:
    FlatFacadeBuilder(const utymap::builders::BuilderContext& builderContext,
                       utymap::builders::MeshContext& meshContext)
        : FacadeBuilder(builderContext, meshContext)
    {
    }

  void build(utymap::meshing::Polygon& polygon)
  {
    utymap::meshing::MeshBuilder::Options options(
        0, // area
        0, // ele noise
        colorNoiseFreq_,
        height_,
        getColorGradient(),
        minHeight_
    );

    std::int64_t last = polygon.points.size() - 2;
    for (auto i = last; i >= 0; i -=2) {
      utymap::meshing::Vector2 p1(polygon.points[i], polygon.points[i + 1]);
      int j = i == 0 ? last : i - 2;
      utymap::meshing::Vector2 p2(polygon.points[j], polygon.points[j + 1]);

      builderContext_.meshBuilder.addPlane(meshContext_.mesh,
                                           p1,
                                           p2,
                                           minHeight_,
                                           minHeight_,
                                           options);
    }
  }
};

}}

#endif // BUILDERS_BUILDINGS_FACADES_FLATFACADEBUILDER_HPP_DEFINED
{'fraction_non_alphanumeric': 0.09525336754329698, 'fraction_numerical': 0.010904425914047467, 'mean_word_length': 2.097318768619662, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1084368', 'n_tokens_mistral': 969, 'n_tokens_neox': 912, 'n_words': 167}