Hotfix for inconsistent slice index

This commit is contained in:
tamasmeszaros 2019-06-26 14:59:39 +02:00
parent 070c9f03fe
commit dd108f4513
2 changed files with 5 additions and 4 deletions

View File

@ -286,7 +286,7 @@ template<class Tout,
class = FloatingOnly<Tout>> class = FloatingOnly<Tout>>
inline SLIC3R_CONSTEXPR Tout scaled(const Tin &v) SLIC3R_NOEXCEPT inline SLIC3R_CONSTEXPR Tout scaled(const Tin &v) SLIC3R_NOEXCEPT
{ {
return static_cast<Tout>(v / static_cast<Tout>(SCALING_FACTOR)); return static_cast<Tout>(v / static_cast<Tin>(SCALING_FACTOR));
} }
// Conversion definition from unscaled to integer 'scaled coord'. // Conversion definition from unscaled to integer 'scaled coord'.
@ -297,7 +297,7 @@ template<class Tout = coord_t, class Tin, class = FloatingOnly<Tin>>
inline SLIC3R_CONSTEXPR ScaledCoordOnly<Tout> scaled(const Tin &v) SLIC3R_NOEXCEPT inline SLIC3R_CONSTEXPR ScaledCoordOnly<Tout> scaled(const Tin &v) SLIC3R_NOEXCEPT
{ {
//return static_cast<Tout>(std::round(v / SCALING_FACTOR)); //return static_cast<Tout>(std::round(v / SCALING_FACTOR));
return static_cast<Tout>(v / static_cast<Tout>(SCALING_FACTOR)); return static_cast<Tout>(v / static_cast<Tin>(SCALING_FACTOR));
} }
// Conversion for Eigen vectors (N dimensional points) // Conversion for Eigen vectors (N dimensional points)

View File

@ -720,8 +720,9 @@ void SLAPrint::process()
if(slindex_it == po.m_slice_index.end()) if(slindex_it == po.m_slice_index.end())
//TRN To be shown at the status bar on SLA slicing error. //TRN To be shown at the status bar on SLA slicing error.
throw std::runtime_error(L("Slicing had to be stopped " throw std::runtime_error(
"due to an internal error.")); L("Slicing had to be stopped due to an internal error: "
"Inconsistent slice index."));
po.m_model_height_levels.clear(); po.m_model_height_levels.clear();
po.m_model_height_levels.reserve(po.m_slice_index.size()); po.m_model_height_levels.reserve(po.m_slice_index.size());