mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-10 10:25:36 +01:00
Fail back to face profile if no sketch is present for extrude and revolve
This commit is contained in:
parent
459a3219ef
commit
ce75c904b4
2 changed files with 20 additions and 5 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue