diff --git a/src/libslic3r/Point.hpp b/src/libslic3r/Point.hpp index 1a1eeb8c5b..32dcb82d05 100644 --- a/src/libslic3r/Point.hpp +++ b/src/libslic3r/Point.hpp @@ -112,7 +112,7 @@ inline double angle(const Eigen::MatrixBase &v1, const Eigen::MatrixBas template Eigen::Matrix to_2d(const Eigen::MatrixBase &ptN) { static_assert(Derived::IsVectorAtCompileTime && int(Derived::SizeAtCompileTime) >= 3, "to_2d(): first parameter is not a 3D or higher dimensional vector"); - return ptN.head<2>(); + return ptN.template head<2>(); } template diff --git a/src/libslic3r/SupportSpotsGenerator.cpp b/src/libslic3r/SupportSpotsGenerator.cpp index 66c6de7a9d..c714bc7c11 100644 --- a/src/libslic3r/SupportSpotsGenerator.cpp +++ b/src/libslic3r/SupportSpotsGenerator.cpp @@ -121,7 +121,7 @@ public: Vec3f get_cell_center(const Vec3i &cell_coords) const { - return origin + cell_coords.cast().cwiseProduct(this->cell_size) + this->cell_size.cwiseQuotient(Vec3f(2.0f, 2.0f, 2.0)); + return origin + cell_coords.cast().cwiseProduct(this->cell_size) + this->cell_size.cwiseQuotient(Vec3f(2.0f, 2.0f, 2.0f)); } void take_position(const Vec3f &position) { taken_cells.insert(to_cell_index(to_cell_coords(position))); } @@ -199,16 +199,6 @@ struct ExtrusionPropertiesAccumulator } }; -// base function: ((e^(((1)/(x^(2)+1)))-1)/(e-1)) -// checkout e.g. here: https://www.geogebra.org/calculator -float gauss(float value, float mean_x_coord, float mean_value, float falloff_speed) -{ - float shifted = value - mean_x_coord; - float denominator = falloff_speed * shifted * shifted + 1.0f; - float exponent = 1.0f / denominator; - return mean_value * (std::exp(exponent) - 1.0f) / (std::exp(1.0f) - 1.0f); -} - std::vector to_short_lines(const ExtrusionEntity *e, float length_limit) { assert(!e->is_collection()); diff --git a/src/libslic3r/TriangleMeshSlicer.cpp b/src/libslic3r/TriangleMeshSlicer.cpp index 9374ebc870..85e170bd03 100644 --- a/src/libslic3r/TriangleMeshSlicer.cpp +++ b/src/libslic3r/TriangleMeshSlicer.cpp @@ -206,7 +206,7 @@ inline FacetSliceType slice_facet( // All three vertices are aligned with slice_z. line_out.edge_type = IntersectionLine::FacetEdgeType::Horizontal; result = FacetSliceType::Cutting; - double normal = cross2((to_2d(v1) - to_2d(v0)).cast(), (to_2d(v2) - to_2d(v1)).cast()); + double normal = cross2((to_2d(v1) - to_2d(v0)).template cast(), (to_2d(v2) - to_2d(v1)).template cast()); if (normal < 0) { // If normal points downwards this is a bottom horizontal facet so we reverse its point order. std::swap(a, b); @@ -292,7 +292,7 @@ inline FacetSliceType slice_facet( static_cast(point) = t <= 0. ? v3f_scaled_to_contour_point(*a) : t >= 1. ? v3f_scaled_to_contour_point(*b) : - v3f_scaled_to_contour_point(a->head<2>().cast() * (1. - t) + b->head<2>().cast() * t + Vec2d(0.5, 0.5)); + v3f_scaled_to_contour_point(a->template head<2>().template cast() * (1. - t) + b->template head<2>().template cast() * t + Vec2d(0.5, 0.5)); point.edge_id = edge_id; ++ num_points; #endif