From ef5807e36b356ca3772a147829b74d2b0890dc2a Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Fri, 16 Nov 2018 17:25:23 +0100 Subject: [PATCH] Separate methods to get the sliced polygons. --- src/libslic3r/SLAPrint.cpp | 18 ++++++++++++++++++ src/libslic3r/SLAPrint.hpp | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index da24e71c69..cb21539682 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -438,6 +438,24 @@ SLAPrintObject::SLAPrintObject(SLAPrint *print, ModelObject *model_object): SLAPrintObject::~SLAPrintObject() {} +double SLAPrintObject::get_elevation() const { + return m_supportdata && m_supportdata->support_tree_ptr? + m_supportdata->support_tree_ptr->get_elevation() : + 0; +} + +const std::vector &SLAPrintObject::get_support_slices() const +{ + if(!m_supportdata) return {}; + + return m_supportdata->support_slices; +} + +const std::vector &SLAPrintObject::get_model_slices() const +{ + return m_model_slices; +} + TriangleMesh SLAPrintObject::support_mesh() const { TriangleMesh trm; diff --git a/src/libslic3r/SLAPrint.hpp b/src/libslic3r/SLAPrint.hpp index de8c6cdae2..485dcf068c 100644 --- a/src/libslic3r/SLAPrint.hpp +++ b/src/libslic3r/SLAPrint.hpp @@ -62,6 +62,15 @@ public: std::vector transformed_support_points() const; + // Get the needed Z elevation for the model geometry if supports should be + // displayed. This Z offset should also be applied to the support + // geometries. Note that this is not the same as the value stored in config + // as the pad height also needs to be considered. + double get_elevation() const; + + const std::vector& get_support_slices() const; + const std::vector& get_model_slices() const; + // I refuse to grantee copying (Tamas) SLAPrintObject(const SLAPrintObject&) = delete; SLAPrintObject& operator=(const SLAPrintObject&) = delete;