Try and catch errors when getting the tool profile
This commit is contained in:
@@ -783,11 +783,14 @@ cSimTool::cSimTool(const TopoDS_Shape& toolShape, float res){
|
||||
|
||||
float cSimTool::GetToolProfileAt(float pos) // pos is -1..1 location along the radius of the tool (0 is center)
|
||||
{
|
||||
float radPos = std::abs(pos) * radius;
|
||||
toolShapePoint test; test.radiusPos = radPos;
|
||||
auto it = std::lower_bound(m_toolShape.begin(), m_toolShape.end(), test, toolShapePoint::less_than());
|
||||
|
||||
return it->heightPos;
|
||||
try{
|
||||
float radPos = std::abs(pos) * radius;
|
||||
toolShapePoint test; test.radiusPos = radPos;
|
||||
auto it = std::lower_bound(m_toolShape.begin(), m_toolShape.end(), test, toolShapePoint::less_than());
|
||||
return it->heightPos;
|
||||
}catch(...){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool cSimTool::isInside(const TopoDS_Shape& toolShape, Base::Vector3d pnt, float res)
|
||||
|
||||
Reference in New Issue
Block a user