check the toolbit shape is valid

This commit is contained in:
Daniel Wood
2020-05-04 20:19:25 +01:00
parent f8e4222506
commit 9bdba32f54
2 changed files with 13 additions and 1 deletions

View File

@@ -23,6 +23,7 @@
#include "PreCompiled.h"
#include <Base/Console.h>
#include <BRepCheck_Analyzer.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <gp_Pnt.hxx>
@@ -717,7 +718,14 @@ void Point3D::UpdateCmd(Path::Command & cmd)
// Simulation tool
//************************************************************************************************************
cSimTool::cSimTool(const TopoDS_Shape& toolShape, float res){
BRepCheck_Analyzer aChecker(toolShape);
bool shapeIsValid = aChecker.IsValid() ? true : false;
if(!shapeIsValid){
throw Base::RuntimeError("Path Simulation: Error in tool geometry");
}
Bnd_Box boundBox;
BRepBndLib::Add(toolShape, boundBox);