Skip to content

Documentation / @geoverse/editor-core / DifferencePolygonsCommand

Class: DifferencePolygonsCommand

Defined in: packages/editor-core/src/commands/differencePolygons.ts:18

面差集(2→1,布尔 A−B):第一个选中的面减去第二个(JSTS difference)。 B 跨边界则在 A 上切出缺口、B 完全在内部则成洞、B 覆盖 A 则结果为空(抛错)。 A、B 均被移除,结果继承 A 的属性。

Implements

Constructors

Constructor

ts
new DifferencePolygonsCommand(ids): DifferencePolygonsCommand;

Defined in: packages/editor-core/src/commands/differencePolygons.ts:21

Parameters

ids

string[]

Returns

DifferencePolygonsCommand

Properties

appliesTo

ts
readonly appliesTo: readonly GeometryKind[];

Defined in: packages/editor-core/src/commands/differencePolygons.ts:20

适用的几何类型(声明式);命令在 plan() 开头用 assertApplicable 据此硬拦截。

Implementation of

Command.appliesTo


label

ts
readonly label: "面差集" = '面差集';

Defined in: packages/editor-core/src/commands/differencePolygons.ts:19

Implementation of

Command.label

Methods

plan()

ts
plan(ctx): ChangeSet;

Defined in: packages/editor-core/src/commands/differencePolygons.ts:23

Parameters

ctx

EditContext

Returns

ChangeSet

Implementation of

Command.plan