File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
packages/chili/src/commands Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,11 @@ export abstract class BooleanOperate extends CreateCommand {
3333 protected override getSteps ( ) : IStep [ ] {
3434 return [
3535 new SelectModelStep ( "prompt.select.shape" , false ) ,
36- new SelectModelStep ( "prompt.select.shape" , false ) ,
36+ new SelectModelStep ( "prompt.select.shape" , false , {
37+ allow : ( shape ) => {
38+ return ! this . stepDatas [ 0 ] . models ?. map ( ( x ) => x . shape ( ) ) . includes ( shape ) ;
39+ } ,
40+ } ) ,
3741 ] ;
3842 }
3943}
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ export class ConvertToWire extends CreateCommand {
2222 return new GeometryModel ( this . document , `Wire ${ count ++ } ` , wireBody ) ;
2323 }
2424
25+ protected override shouldClearSelectedBeforeExcute ( ) {
26+ return false ;
27+ }
28+
2529 protected override getSteps ( ) : IStep [ ] {
2630 return [
2731 new SelectModelStep ( "prompt.select.edges" , true , {
@@ -47,6 +51,10 @@ export class ConvertToFace extends CreateCommand {
4751 return new GeometryModel ( this . document , `Face ${ count ++ } ` , wireBody ) ;
4852 }
4953
54+ protected override shouldClearSelectedBeforeExcute ( ) {
55+ return false ;
56+ }
57+
5058 protected override getSteps ( ) : IStep [ ] {
5159 return [
5260 new SelectModelStep ( "prompt.select.edges" , true , {
Original file line number Diff line number Diff line change @@ -14,8 +14,14 @@ export abstract class CreateCommand extends MultistepCommand {
1414
1515 protected abstract create ( ) : GeometryModel ;
1616
17+ protected shouldClearSelectedBeforeExcute ( ) {
18+ return true ;
19+ }
20+
1721 protected override beforeExecute ( ) : Promise < boolean > {
18- this . document . selection . clearSelected ( ) ;
22+ if ( this . shouldClearSelectedBeforeExcute ( ) ) {
23+ this . document . selection . clearSelected ( ) ;
24+ }
1925 return super . beforeExecute ( ) ;
2026 }
2127}
You can’t perform that action at this time.
0 commit comments