Skip to content

Commit

Permalink
A bit of leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Vaxman committed Apr 6, 2021
1 parent 1a3020d commit 451bcfb
Show file tree
Hide file tree
Showing 4 changed files with 81,757 additions and 6 deletions.
39 changes: 39 additions & 0 deletions include/hedra/reorient.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// This file is part of libhedra, a library for polyhedral mesh processing
//
// Copyright (C) 2020 Amir Vaxman <[email protected]>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef HEDRA_REORIENT_H
#define HEDRA_REORIENT_H
#include <igl/igl_inline.h>
#include <Eigen/Core>
#include <string>
#include <vector>
#include <cstdio>

namespace hedra
{
// reorients mesh consistently
IGL_INLINE void reorient(const Eigen::VectorXi& D,
Eigen::MatrixXi& F
int seedFace = 0)
{

VectorXi visited=VectorXi::Zero(D.size());
std::queue<int>
while !
vertexValences.conservativeResize(EV.maxCoeff()+1);
vertexValences.setZero();
for (int i=0;i<EV.rows();i++){
vertexValences(EV(i,0))++;
vertexValences(EV(i,1))++;
}
}
}


#endif


8 changes: 3 additions & 5 deletions tutorial/101_Visualization/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ int main(int argc, char *argv[])
{
using namespace std;

hedra::polygonal_read_OFF(TUTORIAL_SHARED_PATH "/rhombitruncated_cubeoctahedron_fixed.off", VMesh, D, F);

std::cout<<"1 Switch polygonal edges/triangulated edges"<<
"2 Switch vertex spheres on/off"<<
"3 Switch face normals on/off"<<std::endl;
hedra::polygonal_read_OFF(argv[1], VDOG, DDOG, FDOG);
libigl::read_obj_(argv[2], VWedge, DWedge, F);


sphereColors.resize(VMesh.rows(),3);
for (int i=0;i<VMesh.rows();i++)
sphereColors.row(i)<<(double)i/(double)VMesh.rows(), 1.0-(double)i/(double)VMesh.rows(), 0.0;
Expand Down
2 changes: 1 addition & 1 deletion tutorial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ option(LIBIGL_WITH_EMBREE "Use Embree" ON)
option(LIBIGL_WITH_CGAL "Use Cgal" ON)

### libhedra options
option(LIBHEDRA_WITH_CERES "Use Ceres" ON)
option(LIBHEDRA_WITH_CERES "Use Ceres" OFF)


### Adding libIGL and libhedra: choose the path to your local copy
Expand Down
Loading

0 comments on commit 451bcfb

Please sign in to comment.