|
2 | 2 | #include <gmds/blocking/CurvedBlockingClassifier.h> |
3 | 3 | #include <gmds/utils/Exception.h> |
4 | 4 | /*----------------------------------------------------------------------------*/ |
| 5 | +#include <limits> |
| 6 | +/*----------------------------------------------------------------------------*/ |
5 | 7 | using namespace gmds; |
6 | 8 | using namespace gmds::blocking; |
7 | 9 | /*----------------------------------------------------------------------------*/ |
@@ -238,8 +240,8 @@ CurvedBlockingClassifier::classify_edges(gmds::blocking::ClassificationErrors &A |
238 | 240 | } |
239 | 241 | else if ((geo_d0==0 && geo_d1==1) || (geo_d0==1 && geo_d1==0)){ |
240 | 242 | //we check if the point is adjacent to the curve |
241 | | - auto p_id = (geo_d0<geo_d1)?geo_d0:geo_d1; |
242 | | - auto c_id = (geo_d0>geo_d1)?geo_d0:geo_d1; |
| 243 | + auto p_id = (geo_d0<geo_d1)?geo_i0:geo_i1; |
| 244 | + auto c_id = (geo_d0>geo_d1)?geo_i0:geo_i1; |
243 | 245 | cad::GeomPoint* p = m_geom_model->getPoint(p_id); |
244 | 246 | cad::GeomCurve* c = m_geom_model->getCurve(c_id); |
245 | 247 | std::vector<cad::GeomPoint*> c_points = c->points(); |
@@ -664,13 +666,14 @@ CurvedBlockingClassifier::get_cut_info(int pointId, std::vector<std::vector<Curv |
664 | 666 |
|
665 | 667 | auto listEdgesPara = m_blocking->get_all_sheet_edge_sets(); |
666 | 668 | std::vector<gmds::blocking::CurvedBlocking::Edge > listEdgesSplitable; |
667 | | - unsigned int distMini = 1000; |
| 669 | + double distMini = std::numeric_limits<double>::max(); |
668 | 670 | for(auto edges : listEdgesPara){ |
669 | 671 | auto projInfo = m_blocking->get_projection_info(p,edges); |
670 | 672 | for(int i =0; i< projInfo.size();i++){ |
671 | 673 | if(projInfo[i].second<1 && projInfo[i].second>0 && projInfo[i].first <distMini){ |
672 | 674 | paramCut.first = edges.at(i); |
673 | 675 | paramCut.second = projInfo[i].second; |
| 676 | + distMini=projInfo[i].first; |
674 | 677 | } |
675 | 678 | } |
676 | 679 | } |
|
0 commit comments