Skip to content

Documentation / @geoverse/editor-core / OffsetCommand

Class: OffsetCommand

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

偏移复制(0→1,仅 added):线用平面平行偏移(尖角斜接),面/多面用 JSTS 平行偏移 (JOIN_MITRE 尖角,非默认圆角)。distance 为工作 CRS 单位(线:左法向正;面:外扩正、内缩负)。 注意面为等距平行偏移,外扩/内缩会改变面积(这是平行偏移的固有性质,非整体平移复制)。

Implements

Constructors

Constructor

ts
new OffsetCommand(id, distance): OffsetCommand;

Defined in: packages/editor-core/src/commands/offset.ts:26

Parameters

id

string

distance

number

Returns

OffsetCommand

Properties

appliesTo

ts
readonly appliesTo: readonly GeometryKind[];

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

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

Implementation of

Command.appliesTo


label

ts
readonly label: "偏移复制" = '偏移复制';

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

Implementation of

Command.label

Methods

plan()

ts
plan(ctx): ChangeSet;

Defined in: packages/editor-core/src/commands/offset.ts:31

Parameters

ctx

EditContext

Returns

ChangeSet

Implementation of

Command.plan