Added error handling to fillet operation.

This commit is contained in:
Mike Molinari 2022-10-26 19:31:16 +00:00 committed by Val Erastov
parent 2de9e7f98e
commit 4fa2663cf5

View file

@ -61,9 +61,10 @@ export const FilletOperation: OperationDescriptor<any> = {
});
//perform the opperations on each of the bodies.
const result = {
let result = {
created: [],
consumed: Array.from(groups.keys())
consumed: Array.from(groups.keys()),
error: {},
}
const analyzer = new FromMObjectProductionAnalyzer(result.consumed);
@ -79,6 +80,31 @@ export const FilletOperation: OperationDescriptor<any> = {
result.created.push(occ.io.getShell(newShellName, analyzer));
});
result.created.forEach(function (item, index, arr ){
if (item.faces.length <=1) result = {
created: [],
consumed:[],
error :{
type:"fail",
message:"Fillet failed, Try changing radius or remove edge causing failure."
},
};
})
if (result.created[0].faces.length <=1) result = {
created: [],
consumed:[],
error :{
type:"fail",
message:"Fillet failed, Try changing radius or remove edge causing failure."
},
};
return result;
},
form: [