From ba82cbe007caf8b17b0507b5681c8b3c0f8e7a77 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Tue, 2 Jul 2019 10:32:01 +0200 Subject: [PATCH] Fix broken partial arrange --- src/libslic3r/Arrange.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/libslic3r/Arrange.cpp b/src/libslic3r/Arrange.cpp index 3abe49531..87289d968 100644 --- a/src/libslic3r/Arrange.cpp +++ b/src/libslic3r/Arrange.cpp @@ -340,28 +340,26 @@ class AutoArranger {}; template class _ArrBase { public: - // Useful type shortcuts... using Placer = typename placers::_NofitPolyPlacer; using Selector = selections::_FirstFitSelection; - using Packer = Nester; - using PConfig = typename Packer::PlacementConfig; + using Packer = Nester; + using PConfig = typename Packer::PlacementConfig; using Distance = TCoord; - + protected: - - Packer m_pck; - PConfig m_pconf; // Placement configuration - double m_bin_area; - SpatIndex m_rtree; // spatial index for the normal (bigger) objects + Packer m_pck; + PConfig m_pconf; // Placement configuration + double m_bin_area; + SpatIndex m_rtree; // spatial index for the normal (bigger) objects SpatIndex m_smallsrtree; // spatial index for only the smaller items - double m_norm; // A coefficient to scale distances + double m_norm; // A coefficient to scale distances MultiPolygon m_merged_pile; // The already merged pile (vector of items) - Box m_pilebb; // The bounding box of the merged pile. - ItemGroup m_remaining; // Remaining items (m_items at the beginning) - ItemGroup m_items; // The items to be packed + Box m_pilebb; // The bounding box of the merged pile. + ItemGroup m_remaining; // Remaining items (m_items at the beginning) + ItemGroup m_items; // The items to be packed + public: - _ArrBase(const TBin& bin, Distance dist, std::function progressind, std::function stopcond): @@ -715,8 +713,8 @@ bool arrange(ArrangeablePtrs & arrangables, clpath.Contour.emplace_back(firstp); outp.emplace_back(applyfn, std::move(clpath)); - outp.front().rotation(rotation); - outp.front().translation({offs.x(), offs.y()}); + outp.back().rotation(rotation); + outp.back().translation({offs.x(), offs.y()}); }; for (Arrangeable *arrangeable : arrangables) {