Skip to content

Documentation / @geoverse/editor-libre / OffsetCommand

Class: OffsetCommand

Defined in: editor-core/dist/commands/offset.d.ts:7

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

Implements

  • Command

Constructors

Constructor

ts
new OffsetCommand(id, distance): OffsetCommand;

Defined in: editor-core/dist/commands/offset.d.ts:12

Parameters

id

string

distance

number

Returns

OffsetCommand

Properties

appliesTo

ts
readonly appliesTo: readonly GeometryKind[];

Defined in: editor-core/dist/commands/offset.d.ts:11

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

Implementation of

ts
Command.appliesTo

label

ts
readonly label: "偏移复制" = "\u504F\u79FB\u590D\u5236";

Defined in: editor-core/dist/commands/offset.d.ts:10

Implementation of

ts
Command.label

Methods

plan()

ts
plan(ctx): ChangeSet;

Defined in: editor-core/dist/commands/offset.d.ts:13

Parameters

ctx

EditContext

Returns

ChangeSet

Implementation of

ts
Command.plan