mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +01:00
Added error handling to fillet operation.
This commit is contained in:
parent
2de9e7f98e
commit
4fa2663cf5
1 changed files with 28 additions and 2 deletions
|
|
@ -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: [
|
||||
|
|
|
|||
Loading…
Reference in a new issue