OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::TriangleMeshDeal Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/TriangleMeshDeal.hpp>

Static Public Member Functions

static TriangleMesh smooth_triangle_mesh (const TriangleMesh &mesh, bool &ok)

Detailed Description

Member Function Documentation

◆ smooth_triangle_mesh()

TriangleMesh Slic3r::TriangleMeshDeal::smooth_triangle_mesh ( const TriangleMesh & mesh,
bool & ok )
static
12{
13 {
14 using namespace igl;
15 typedef Eigen::Matrix<float, Eigen::Dynamic, 3, Eigen::DontAlign | Eigen::RowMajor> RowMatrixX3f;
16 typedef Eigen::Matrix<int, Eigen::Dynamic, 3, Eigen::DontAlign | Eigen::RowMajor> RowMatrixX3i;
17
18 auto vertices_count = mesh.its.vertices.size();
19 auto indices_count = mesh.its.indices.size();
20 // Use Map to map the vertices and indicies into Matrixes without requiring a copy.
21 const Eigen::Map<const RowMatrixX3f> OV(mesh.its.vertices[0].data(), vertices_count, 3);
22 const Eigen::Map<const RowMatrixX3i> OF(mesh.its.indices[0].data(), indices_count, 3);
23 Eigen::MatrixX3f V;
24 Eigen::MatrixX3i F;
25
26 ok = true;
27 // TODO: add validation checks for the input mesh? Is this really necessary?
28 // if ( <not OK> ) {
29 // ok = false;
30 // return TriangleMesh();
31 // }
32 loop(OV, OF, V, F);
33
34 indexed_triangle_set its;
35 auto iterv = V.rowwise();
36 auto iterf = F.rowwise();
37 its.vertices.assign(iterv.cbegin(), iterv.cend());
38 its.indices.assign(iterf.cbegin(), iterf.cend());
39 TriangleMesh result_mesh(its);
40 return result_mesh;
41 }
42}
@ F
Definition libslic3r.h:145

References Slic3r::F, and Slic3r::TriangleMesh::its.

Referenced by Slic3r::GUI::ObjectList::smooth_mesh().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: