Skip to content

Documentation / @geoverse/editor-core / PunchHoleCommand

Class: PunchHoleCommand

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

面挖洞(2→1,结构插入内环):把第二个选中的面作为洞,结构性插入第一个面(目标)的内环。 与「面差集」的区别:非布尔运算,精确保留目标外边界;要求洞完全落在目标内部。 目标须为单面 Polygon;洞可为 Polygon/MultiPolygon(逐个外环插入)。两要素均被移除,结果继承目标属性。

Implements

Constructors

Constructor

ts
new PunchHoleCommand(ids): PunchHoleCommand;

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

Parameters

ids

string[]

Returns

PunchHoleCommand

Properties

appliesTo

ts
readonly appliesTo: readonly GeometryKind[];

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

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

Implementation of

Command.appliesTo


label

ts
readonly label: "面挖洞" = '面挖洞';

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

Implementation of

Command.label

Methods

plan()

ts
plan(ctx): ChangeSet;

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

Parameters

ctx

EditContext

Returns

ChangeSet

Implementation of

Command.plan