mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-09-26 07:03:12 +08:00

* 1. Remove all global include_directories. * 2. Move 3d party dependencies from src to budled deps if possible. * Unify and enforce one way of including headers: e.g. #include "libslic3r/GCode.hpp" vs #include "GCode.hpp" (always use the "libslic3r/GCode.hpp" option). * Make all dependencies (also header only) a cmake target.
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
// This file is part of libigl, a simple c++ geometry processing library.
|
|
//
|
|
// Copyright (C) 2014 Daniele Panozzo <daniele.panozzo@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 "rotate_vectors.h"
|
|
IGL_INLINE Eigen::MatrixXd igl::rotate_vectors(
|
|
const Eigen::MatrixXd& V,
|
|
const Eigen::VectorXd& A,
|
|
const Eigen::MatrixXd& B1,
|
|
const Eigen::MatrixXd& B2)
|
|
{
|
|
Eigen::MatrixXd RV(V.rows(),V.cols());
|
|
|
|
for (unsigned i=0; i<V.rows();++i)
|
|
{
|
|
double norm = V.row(i).norm();
|
|
|
|
// project onto the tangent plane and convert to angle
|
|
double a = atan2(B2.row(i).dot(V.row(i)),B1.row(i).dot(V.row(i)));
|
|
|
|
// rotate
|
|
a += (A.size() == 1) ? A(0) : A(i);
|
|
|
|
// move it back to global coordinates
|
|
RV.row(i) = norm*cos(a) * B1.row(i) + norm*sin(a) * B2.row(i);
|
|
}
|
|
|
|
return RV;
|
|
}
|
|
|
|
#ifdef IGL_STATIC_LIBRARY
|
|
// Explicit template instantiation
|
|
#endif
|