mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 08:41:11 -06:00
Building igl statically and moving to the dep scripts
Fixing dep build script on Windows and removing some warnings. Use bundled igl by default. Not building with the dependency scripts if not explicitly stated. This way, it will stay in Fix the libigl patch to include C source files in header only mode.
This commit is contained in:
parent
89e39e3895
commit
2ae2672ee9
1095 changed files with 181 additions and 5 deletions
71
src/libigl/igl/circulation.cpp
Normal file
71
src/libigl/igl/circulation.cpp
Normal file
|
@ -0,0 +1,71 @@
|
|||
// This file is part of libigl, a simple c++ geometry processing library.
|
||||
//
|
||||
// Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
|
||||
//
|
||||
// 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/.
|
||||
#include "circulation.h"
|
||||
#include "list_to_matrix.h"
|
||||
|
||||
IGL_INLINE std::vector<int> igl::circulation(
|
||||
const int e,
|
||||
const bool ccw,
|
||||
const Eigen::MatrixXi & F,
|
||||
const Eigen::MatrixXi & E,
|
||||
const Eigen::VectorXi & EMAP,
|
||||
const Eigen::MatrixXi & EF,
|
||||
const Eigen::MatrixXi & EI)
|
||||
{
|
||||
// prepare output
|
||||
std::vector<int> N;
|
||||
N.reserve(6);
|
||||
const int m = F.rows();
|
||||
const auto & step = [&](
|
||||
const int e,
|
||||
const int ff,
|
||||
int & ne,
|
||||
int & nf)
|
||||
{
|
||||
assert((EF(e,1) == ff || EF(e,0) == ff) && "e should touch ff");
|
||||
//const int fside = EF(e,1)==ff?1:0;
|
||||
const int nside = EF(e,0)==ff?1:0;
|
||||
const int nv = EI(e,nside);
|
||||
// get next face
|
||||
nf = EF(e,nside);
|
||||
// get next edge
|
||||
const int dir = ccw?-1:1;
|
||||
ne = EMAP(nf+m*((nv+dir+3)%3));
|
||||
};
|
||||
// Always start with first face (ccw in step will be sure to turn right
|
||||
// direction)
|
||||
const int f0 = EF(e,0);
|
||||
int fi = f0;
|
||||
int ei = e;
|
||||
while(true)
|
||||
{
|
||||
step(ei,fi,ei,fi);
|
||||
N.push_back(fi);
|
||||
// back to start?
|
||||
if(fi == f0)
|
||||
{
|
||||
assert(ei == e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return N;
|
||||
}
|
||||
|
||||
IGL_INLINE void igl::circulation(
|
||||
const int e,
|
||||
const bool ccw,
|
||||
const Eigen::MatrixXi & F,
|
||||
const Eigen::MatrixXi & E,
|
||||
const Eigen::VectorXi & EMAP,
|
||||
const Eigen::MatrixXi & EF,
|
||||
const Eigen::MatrixXi & EI,
|
||||
Eigen::VectorXi & vN)
|
||||
{
|
||||
std::vector<int> N = circulation(e,ccw,F,E,EMAP,EF,EI);
|
||||
igl::list_to_matrix(N,vN);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue