Fail back to face profile if no sketch is present for extrude and revolve

This commit is contained in:
Mike Molinari 2022-02-23 23:56:46 +00:00 committed by Val Erastov
parent 459a3219ef
commit ce75c904b4
2 changed files with 20 additions and 5 deletions

View file

@ -28,10 +28,19 @@ export const ExtrudeOperation: OperationDescriptor<ExtrudeParams> = {
const face = params.face;
let sketch = ctx.sketchStorageService.readSketch(face.id);
if (!sketch) throw 'sketch not found for the face ' + face.id;
let occFaces = [];
let sketch = ctx.sketchStorageService.readSketch(face.id);
if (!sketch) {
occFaces.push(params.face);
} else {
occFaces = occ.utils.sketchToFaces(sketch, face.csys);
}
const occFaces = occ.utils.sketchToFaces(sketch, face.csys);
const dir: UnitVector = params.direction || face.normal();

View file

@ -26,9 +26,15 @@ export const RevolveOperation: OperationDescriptor<RevolveParams> = {
const face = params.face;
let occFaces = [];
let sketch = ctx.sketchStorageService.readSketch(face.id);
if (!sketch) throw 'sketch not found for the face ' + face.id;
const occFaces = occ.utils.sketchToFaces(sketch, face.csys);
if (!sketch) {
occFaces.push(params.face);
}else{
occFaces = occ.utils.sketchToFaces(sketch, face.csys);
}
const tools = occFaces.map((faceName, i) => {