From 3858fecf0c082ef3670c4c403a6947bdf94fb8b0 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Tue, 13 Nov 2018 19:22:05 +0100 Subject: [PATCH] Fixed merge conflict: Added ModelInstance ID to the SLAPrintObject Instance --- src/libslic3r/SLAPrint.cpp | 4 ++-- src/libslic3r/SLAPrint.hpp | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 7448c85cdf..0a0b0ff5c6 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -96,11 +96,11 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, for (ModelObject *model_object : m_model.objects) { auto po = new SLAPrintObject(this, model_object); m_objects.emplace_back(po); - for(ModelInstance *oinst : model_object->instances) { + for (ModelInstance *oinst : model_object->instances) { Point tr = Point::new_scale(oinst->get_offset()(X), oinst->get_offset()(Y)); auto rotZ = float(oinst->get_rotation()(Z)); - po->m_instances.emplace_back(tr, rotZ); + po->m_instances.emplace_back(oinst->id(), tr, rotZ); } } } diff --git a/src/libslic3r/SLAPrint.hpp b/src/libslic3r/SLAPrint.hpp index 7e0d0b2c20..1d1bb3bb9e 100644 --- a/src/libslic3r/SLAPrint.hpp +++ b/src/libslic3r/SLAPrint.hpp @@ -40,12 +40,14 @@ public: const Transform3d& trafo() const { return m_trafo; } struct Instance { - ModelID instance_id; - // Slic3r::Point objects in scaled G-code coordinates + Instance(ModelID instance_id, const Point &shift, float rotation) : instance_id(instance_id), shift(shift), rotation(rotation) {} + // ID of the corresponding ModelInstance. + ModelID instance_id; + // Slic3r::Point objects in scaled G-code coordinates Point shift; // Rotation along the Z axis, in radians. float rotation; - }; + }; const std::vector& instances() const { return m_instances; } // Get a support mesh centered around origin in XY, and with zero rotation around Z applied.