-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47768af
commit afea788
Showing
10 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2022-2023 the Chili authors. All rights reserved. AGPL-3.0 license. | ||
|
||
import { EditableGeometryEntity, GeometryEntity, ShapeType, command } from "chili-core"; | ||
import { IStep } from "../../step"; | ||
import { SelectShapeStep } from "../../step/selectStep"; | ||
import { CreateCommand } from "../createCommand"; | ||
|
||
@command({ | ||
name: "create.section", | ||
display: "command.section", | ||
icon: "icon-section", | ||
}) | ||
export class Section extends CreateCommand { | ||
protected override geometryEntity(): GeometryEntity { | ||
let shape = this.stepDatas[0].shapes[0].shape; | ||
let path = this.stepDatas[1].shapes[0].shape; | ||
let section = shape.section(path); | ||
return new EditableGeometryEntity(this.document, section); | ||
} | ||
|
||
protected override getSteps(): IStep[] { | ||
return [ | ||
new SelectShapeStep(ShapeType.Shape, "prompt.select.shape", false), | ||
new SelectShapeStep(ShapeType.Shape, "prompt.select.shape", false), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2022-2023 the Chili authors. All rights reserved. AGPL-3.0 license. | ||
|
||
import { EditableGeometryEntity, GeometryEntity, IEdge, ShapeType, command } from "chili-core"; | ||
import { IStep } from "../../step"; | ||
import { SelectShapeStep } from "../../step/selectStep"; | ||
import { CreateCommand } from "../createCommand"; | ||
|
||
@command({ | ||
name: "modify.split", | ||
display: "command.split", | ||
icon: "icon-split", | ||
}) | ||
export class Split extends CreateCommand { | ||
protected override geometryEntity(): GeometryEntity { | ||
let shape1 = this.stepDatas[0].shapes[0].shape; | ||
let edges = this.stepDatas[1].shapes.map((x) => x.shape) as IEdge[]; | ||
let shapes = shape1.split(edges); | ||
return new EditableGeometryEntity(this.document, shapes); | ||
} | ||
|
||
protected override getSteps(): IStep[] { | ||
return [ | ||
new SelectShapeStep(ShapeType.Shape, "prompt.select.shape", false), | ||
new SelectShapeStep(ShapeType.Edge, "prompt.select.shape", true), | ||
]; | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.