34 #include <boost/optional.hpp> 39 using std::unique_ptr;
40 using std::make_unique;
65 std::cout << options << std::endl;
66 cout <<
"LOAD" << endl;
68 cout <<
"MODEL" << endl;
69 cout << model << endl;
71 cout << meshBuffer << endl;
74 std::cout <<
lvr2::timestamp <<
"Computing face normals..." << std::endl;
83 if (reductionRatio > 0.0)
85 if (reductionRatio > 1.0)
87 throw "The reduction ratio needs to be between 0 and 1!";
92 const auto count =
static_cast<size_t>((mesh.
numFaces() / 2) * reductionRatio);
101 auto buffer = finalizer.
apply(mesh);
size_t simpleMeshReduction(BaseMesh< BaseVecT > &mesh, const size_t count, FaceMap< Normal< typename BaseVecT::CoordType >> &faceNormals)
Like iterativeEdgeCollapse but with a fixed cost function.
int main(int argc, char **argv)
const kaboom::Options * options
std::shared_ptr< MeshBuffer > MeshBufferPtr
string getInputFileName() const
Returns the output file name.
static Timestamp timestamp
A global time stamp object for program runtime measurement.
static ModelPtr readModel(std::string filename)
DenseFaceMap< Normal< typename BaseVecT::CoordType > > calcFaceNormals(const BaseMesh< BaseVecT > &mesh)
Calculates a normal for each face in the mesh.
MeshBufferPtr apply(const BaseMesh< BaseVecT > &mesh)
A class to parse the program options for the reconstruction executable.
Half-edge data structure implementing the BaseMesh interface.
size_t numFaces() const final
Returns the number of faces in the mesh.
float getEdgeCollapseReductionRatio() const
Reduction ratio for mesh reduction via edge collapse.
std::shared_ptr< Model > ModelPtr
static void saveModel(ModelPtr m, std::string file)