mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-27 10:41:15 -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
|
|
@ -1,50 +0,0 @@
|
|||
// This file is part of libigl, a simple c++ geometry processing library.
|
||||
//
|
||||
// Copyright (C) 2016 Michael Rabinovich
|
||||
//
|
||||
// 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 "line_search.h"
|
||||
|
||||
IGL_INLINE double igl::line_search(
|
||||
Eigen::MatrixXd& x,
|
||||
const Eigen::MatrixXd& d,
|
||||
double step_size,
|
||||
std::function<double(Eigen::MatrixXd&)> energy,
|
||||
double cur_energy)
|
||||
{
|
||||
double old_energy;
|
||||
if (cur_energy > 0)
|
||||
{
|
||||
old_energy = cur_energy;
|
||||
}
|
||||
else
|
||||
{
|
||||
old_energy = energy(x); // no energy was given -> need to compute the current energy
|
||||
}
|
||||
double new_energy = old_energy;
|
||||
int cur_iter = 0; int MAX_STEP_SIZE_ITER = 12;
|
||||
|
||||
while (new_energy >= old_energy && cur_iter < MAX_STEP_SIZE_ITER)
|
||||
{
|
||||
Eigen::MatrixXd new_x = x + step_size * d;
|
||||
|
||||
double cur_e = energy(new_x);
|
||||
if ( cur_e >= old_energy)
|
||||
{
|
||||
step_size /= 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = new_x;
|
||||
new_energy = cur_e;
|
||||
}
|
||||
cur_iter++;
|
||||
}
|
||||
return new_energy;
|
||||
}
|
||||
|
||||
|
||||
#ifdef IGL_STATIC_LIBRARY
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue