Skip to content

Commit b00049c

Browse files
committed
retrieved bugfixes for CurvedBlockingClassifier::classify_edges CurvedBlockingClassifier::get_cut_info FACCurve::project
1 parent 4f26a9d commit b00049c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

blocking/src/CurvedBlockingClassifier.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#include <gmds/blocking/CurvedBlockingClassifier.h>
33
#include <gmds/utils/Exception.h>
44
/*----------------------------------------------------------------------------*/
5+
#include <limits>
6+
/*----------------------------------------------------------------------------*/
57
using namespace gmds;
68
using namespace gmds::blocking;
79
/*----------------------------------------------------------------------------*/
@@ -238,8 +240,8 @@ CurvedBlockingClassifier::classify_edges(gmds::blocking::ClassificationErrors &A
238240
}
239241
else if ((geo_d0==0 && geo_d1==1) || (geo_d0==1 && geo_d1==0)){
240242
//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;
243245
cad::GeomPoint* p = m_geom_model->getPoint(p_id);
244246
cad::GeomCurve* c = m_geom_model->getCurve(c_id);
245247
std::vector<cad::GeomPoint*> c_points = c->points();
@@ -664,13 +666,14 @@ CurvedBlockingClassifier::get_cut_info(int pointId, std::vector<std::vector<Curv
664666

665667
auto listEdgesPara = m_blocking->get_all_sheet_edge_sets();
666668
std::vector<gmds::blocking::CurvedBlocking::Edge > listEdgesSplitable;
667-
unsigned int distMini = 1000;
669+
double distMini = std::numeric_limits<double>::max();
668670
for(auto edges : listEdgesPara){
669671
auto projInfo = m_blocking->get_projection_info(p,edges);
670672
for(int i =0; i< projInfo.size();i++){
671673
if(projInfo[i].second<1 && projInfo[i].second>0 && projInfo[i].first <distMini){
672674
paramCut.first = edges.at(i);
673675
paramCut.second = projInfo[i].second;
676+
distMini=projInfo[i].first;
674677
}
675678
}
676679
}

cadfac/src/FACCurve.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ FACCurve::project(math::Point &AP, math::Vector3d &AV) const
217217
std::vector<Node> e_nodes = e.get<Node>();
218218
math::Segment s(e_nodes[0].point(), e_nodes[1].point());
219219
AP = s.project(AP);
220-
AV = e_nodes[1].point() - e_nodes[1].point();
220+
AV = e_nodes[1].point() - e_nodes[0].point();
221221
}
222222
/*----------------------------------------------------------------------------*/
223223
TCoord

0 commit comments

Comments
 (0)