Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsupermerill <merill@fr.fr>2019-06-25 20:05:07 +0300
committersupermerill <merill@fr.fr>2019-06-26 13:27:54 +0300
commit6539365d2e5ee37ece6f81a31702c4353cb213bd (patch)
treec68e63171128c38f5bc6cf3aa53a6c4359be4ebd
parented61aa2f66c21f1b706b701f95722ecffc9c4f24 (diff)
stl->vertexes easy converter
-rw-r--r--src/libslic3r/PrintObject.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp
index 8e1ae49b9..ca8bd517d 100644
--- a/src/libslic3r/PrintObject.cpp
+++ b/src/libslic3r/PrintObject.cpp
@@ -94,6 +94,22 @@ PrintBase::ApplyStatus PrintObject::set_copies(const Points &points)
return status;
}
+void print_vertices(ModelObject * obj) {
+ auto objs = obj->volumes;
+ if (objs.size() > 0) {
+ TriangleMesh mesh = objs[0]->mesh();
+ std::cout << "vertices = std::vector<Vec3d>{\n\t";
+ for (Vec3f vert : mesh.its.vertices) {
+ std::cout << "Vec3d(" << vert.x() << "," << vert.y() << "," << vert.z() << "),";
+ }
+ std::cout << "\n};\nfacets = std::vector<Vec3i32>{ \n\t";
+ for (Vec3i32 face : mesh.its.indices) {
+ std::cout << "Vec3i32(" << face(0) << "," << face(1) << "," << face(2) << "),";
+ }
+ std::cout << "\n};";
+ }
+}
+
// 1) Decides Z positions of the layers,
// 2) Initializes layers and their regions
// 3) Slices the object meshes
@@ -105,6 +121,8 @@ PrintBase::ApplyStatus PrintObject::set_copies(const Points &points)
// this should be idempotent
void PrintObject::slice()
{
+ print_vertices(this->model_object());
+
if (! this->set_started(posSlice))
return;
m_print->set_status(10, L("Processing triangulated mesh"));