Fix for erroneous support slicing.

Adding upper and lower closure for pillars and bridges.
This commit is contained in:
tamasmeszaros 2019-01-28 11:58:25 +01:00
parent 4a5cff3ee2
commit 61d59a7a2e
2 changed files with 55 additions and 5 deletions

View file

@ -5,8 +5,8 @@
#include <functional>
#include <numeric>
#include "ExPolygon.hpp"
#include "TriangleMesh.hpp"
#include <libslic3r/ExPolygon.hpp>
#include <libslic3r/TriangleMesh.hpp>
namespace Slic3r {
namespace sla {
@ -53,7 +53,7 @@ struct Contour3D {
void merge(const Contour3D& ctr) {
auto s3 = coord_t(points.size());
auto s = coord_t(indices.size());
auto s = indices.size();
points.insert(points.end(), ctr.points.begin(), ctr.points.end());
indices.insert(indices.end(), ctr.indices.begin(), ctr.indices.end());
@ -62,6 +62,17 @@ struct Contour3D {
auto& idx = indices[n]; x(idx) += s3; y(idx) += s3; z(idx) += s3;
}
}
// Write the index triangle structure to OBJ file for debugging purposes.
void to_obj(std::ostream& stream) {
for(auto& p : points) {
stream << "v " << p.transpose() << "\n";
}
for(auto& f : indices) {
stream << "f " << (f + Vec3i(1, 1, 1)).transpose() << "\n";
}
}
};
//using PointSet = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign>; //Eigen::MatrixXd;