7 changed files with 283 additions and 223 deletions
@ -1,4 +1,15 @@ |
|||
/*
|
|||
* @File Created: 2022-11-26, 17:43:27 |
|||
* @Last Modified: 2022-11-26, 18:50:24 |
|||
* @Author: forty-twoo |
|||
* @Copyright (c) 2022, Caiyue Li(li_caiyue@zju.edu.cn), All rights reserved. |
|||
*/ |
|||
|
|||
#ifndef NEWTON_H_ |
|||
#define NEWTON_H_ |
|||
|
|||
#include "bvh.hpp" |
|||
|
|||
std::vector<double> newton_curve_curve(BVH_AABB_NodePtr boxPtr1, BVH_AABB_NodePtr boxPtr2, const double &eps, bool &isConvergence); |
|||
|
|||
#endif |
@ -1 +1,31 @@ |
|||
/*
|
|||
* @File Created: 2022-11-26, 17:43:34 |
|||
* @Last Modified: 2022-11-26, 18:50:31 |
|||
* @Author: forty-twoo |
|||
* @Copyright (c) 2022, Caiyue Li(li_caiyue@zju.edu.cn), All rights reserved. |
|||
*/ |
|||
|
|||
#include "newton.hpp" |
|||
#include <Eigen/Core> |
|||
|
|||
std::vector<double> newton_curve_curve(BVH_AABB_NodePtr boxPtr1, BVH_AABB_NodePtr boxPtr2, const double &eps, bool &isConvergence) |
|||
{ |
|||
double param1_st = boxPtr1->param[0].first; |
|||
double param1_ed = boxPtr1->param[0].second; |
|||
|
|||
double param2_st = boxPtr2->param[0].first; |
|||
double param2_ed = boxPtr2->param[0].second; |
|||
|
|||
double t1 = (param1_st + param1_ed) / 2.0; |
|||
double t2 = (param2_st + param2_st) / 2.0; |
|||
|
|||
Eigen::MatrixXd F(2, 2); |
|||
|
|||
tinynurbs::RationalCurve<double> *crvPtr1 = boxPtr1->myBVH->NurbsCurvePtr; |
|||
tinynurbs::array2<double> der_Fx = tinynurbs::bsplineDerBasis(crvPtr1->degree, tinynurbs::findSpan(crvPtr1->degree, crvPtr1->knots, t1), crvPtr1->knots, t1, 1); |
|||
Eigen::Vector2d t(t1, t2); |
|||
|
|||
Eigen::MatrixXd JacobinF(2, 2); |
|||
|
|||
bool iterFlag = true; |
|||
} |
Loading…
Reference in new issue