From 4fa2663cf592b5a8c8dbb66b9702d74a7cfc191d Mon Sep 17 00:00:00 2001 From: Mike Molinari Date: Wed, 26 Oct 2022 19:31:16 +0000 Subject: [PATCH] Added error handling to fillet operation. --- .../features/fillet/fillet.operation.ts | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/modules/workbenches/modeler/features/fillet/fillet.operation.ts b/modules/workbenches/modeler/features/fillet/fillet.operation.ts index f986f12d..f1be3a25 100644 --- a/modules/workbenches/modeler/features/fillet/fillet.operation.ts +++ b/modules/workbenches/modeler/features/fillet/fillet.operation.ts @@ -61,9 +61,10 @@ export const FilletOperation: OperationDescriptor = { }); //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 = { 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: [