diff --git a/vis/include/solver.hpp b/vis/include/solver.hpp index 3c6e7c6..9159c0f 100644 --- a/vis/include/solver.hpp +++ b/vis/include/solver.hpp @@ -86,7 +86,9 @@ public: Mesh recontext(std::vector ctx_); - std::vector> tile(const std::vector &ctx_); + Mesh tile(const std::vector &ctx_); + + std::vector> each_tile(const std::vector &ctx_); Mesh fan(unsigned root); @@ -146,7 +148,12 @@ Mesh Mesh::recontext(std::vector ctx_) { } template -std::vector> Mesh::tile(const std::vector &ctx_) { +Mesh Mesh::tile(const std::vector &ctx_) { + return merge(each_tile(ctx_)); +} + +template +std::vector> Mesh::each_tile(const std::vector &ctx_) { auto base = recontext(ctx_); auto table = solve(*g, base.ctx, {}); @@ -191,7 +198,7 @@ Mesh Mesh::fill(const tc::Group &g, std::vector ctx) { for (const auto &sub_ctx : combos) { auto base = Mesh::fill(g, sub_ctx); - auto parts = base.tile(ctx); + auto parts = base.each_tile(ctx); parts.erase(parts.begin(), parts.begin() + 1); if (parts.empty()) continue; @@ -218,7 +225,7 @@ Mesh Mesh::hull(const tc::Group &g, const std::vector ctx, const SC & std::vector> parts; for (const auto &sub_ctx : sub_ctxs) { - auto face = Mesh::fill(g, sub_ctx).tile(ctx); + auto face = Mesh::fill(g, sub_ctx).each_tile(ctx); parts.insert(parts.end(), face.begin(), face.end()); }