diff --git a/vcg/space/rasterized_outline2_packer.h b/vcg/space/rasterized_outline2_packer.h index 5c52288e..ace38df7 100644 --- a/vcg/space/rasterized_outline2_packer.h +++ b/vcg/space/rasterized_outline2_packer.h @@ -769,6 +769,34 @@ public: return trials; } + static bool PackAtFixedScale(std::vector> &polyPointsVec, + const std::vector &containerSizes, + std::vector &trVec, + std::vector &polyToContainer, + const Parameters &packingPar, + float scale) + { + //create the vector of polys, starting for the poly points we received as parameter + std::vector polyVec(polyPointsVec.size()); + for(size_t i=0;i> trials = InitializePermutationVectors(polyPointsVec, packingPar); + + for (std::size_t i = 0; i < trials.size(); ++i) { + std::vector trVecIter; + std::vector polyToContainerIter; + if (PolyPacking(polyPointsVec, containerSizes, trVecIter, polyToContainerIter, packingPar, scale, polyVec, trials[i], false)) { + trVec = trVecIter; + polyToContainer = polyToContainerIter; + return true; + } + } + + return false; + } + /* * Pack charts using a best effort policy. The idea is that this function * packs what it can in the given space without scaling the outlines.