@weasel-js/path-tools 1.10.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -7
- package/dist/icons.table.d.ts +6 -0
- package/dist/icons.table.js +129 -0
- package/dist/icons.table.js.map +1 -0
- package/dist/icons.table.json +121 -0
- package/dist/index.d.ts +877 -40
- package/dist/index.js +2258 -88
- package/dist/index.js.map +1 -1
- package/package.json +21 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { PathEditExtension, FeaturePreset, EditableShape, BlendEffect, BendAlongEffect, RepeatAlongEffect, PathNode, Tool, SurfaceContribution, EditAnchorsDep } from '@weasel-js/core';
|
|
1
|
+
import { PathEditExtension, SnapSource, FeaturePreset, EditableShape, BlendEffect, BendAlongEffect, RepeatAlongEffect, PathNode, Tool, SurfaceContribution, NodeId, PathPaint, BooleanOpResult, BooleansAdapter, BooleanOpOptions, BooleanStrokes, RenderLayer, SceneNode, PathRepresentation, AnchorMarkerShape, EditAnchorsDep, RectPose, AddNodeSpec } from '@weasel-js/core';
|
|
2
2
|
import { DrawCommand } from '@weasel-js/renderer';
|
|
3
|
-
import { AnchorSet,
|
|
3
|
+
import { AnchorSet, Point, PolygonPath, View, CornerFrame, SoftFalloff, PathConstraintKind, PathConstraint, LengthenMode, Affine, SpiroKind, SegmentType, CornerShape, TrimResult, SpiroPoint, SpiroContour, CornerKeyword } from '@weasel-js/geom';
|
|
4
4
|
import * as _weasel_js_routing from '@weasel-js/routing';
|
|
5
5
|
import { Action, ActionDeps, ToolKeybinding } from '@weasel-js/routing';
|
|
6
6
|
export { ActionParamSchema } from '@weasel-js/routing';
|
|
7
7
|
import { CursorSpec } from '@weasel-js/cursor';
|
|
8
|
+
import { PathWarp, DistortMode, EnvelopeMapping } from '@weasel-js/geom/warp';
|
|
9
|
+
import { VertexWidth, Stroke, HalfWidths } from '@weasel-js/paint';
|
|
10
|
+
import { StrokeEdgeHit, StrokeSide } from '@weasel-js/stroke';
|
|
11
|
+
import { PrefGroup } from '@weasel-js/prefs';
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
* The balance lines path edit can draw over the open path: one per curved
|
|
@@ -24,15 +28,8 @@ interface PathEditBalanceStyle {
|
|
|
24
28
|
/** Radius of the grip, in screen px. Default 4. */
|
|
25
29
|
gripRadiusPx?: number;
|
|
26
30
|
}
|
|
27
|
-
type ToScreen$1 = (p: {
|
|
28
|
-
x: number;
|
|
29
|
-
y: number;
|
|
30
|
-
}) => {
|
|
31
|
-
x: number;
|
|
32
|
-
y: number;
|
|
33
|
-
};
|
|
34
31
|
/** Draw commands for `set`'s balance lines and their grips, in screen space. */
|
|
35
|
-
declare function balanceCommands(set: AnchorSet, toScreen:
|
|
32
|
+
declare function balanceCommands(set: AnchorSet, toScreen: (p: Point) => Point, style?: PathEditBalanceStyle): DrawCommand[];
|
|
36
33
|
/** The balance lines as a path-edit extension: drawn, and their grips
|
|
37
34
|
* pressed, while chrome-caps shows {@link PATH_BALANCE_CHROME_ID}. */
|
|
38
35
|
declare function createBalanceExtension(style?: PathEditBalanceStyle): PathEditExtension;
|
|
@@ -53,25 +50,52 @@ interface PathEditCombOptions {
|
|
|
53
50
|
/** Color of the teeth and of the line through their tips. */
|
|
54
51
|
color?: string;
|
|
55
52
|
}
|
|
56
|
-
type ToScreen = (p: {
|
|
57
|
-
x: number;
|
|
58
|
-
y: number;
|
|
59
|
-
}) => {
|
|
60
|
-
x: number;
|
|
61
|
-
y: number;
|
|
62
|
-
};
|
|
63
53
|
/** Draw commands for `set`'s curvature comb, in screen space. */
|
|
64
|
-
declare function combCommands(set: AnchorSet, toScreen:
|
|
54
|
+
declare function combCommands(set: AnchorSet, toScreen: (p: Point) => Point, opts?: PathEditCombOptions): DrawCommand[];
|
|
65
55
|
/** The comb as a path-edit extension, drawn while chrome-caps shows
|
|
66
56
|
* {@link PATH_COMB_CHROME_ID}. `options` is read every frame. */
|
|
67
57
|
declare function createCombExtension(options?: () => PathEditCombOptions | undefined): PathEditExtension;
|
|
68
58
|
|
|
59
|
+
/**
|
|
60
|
+
* The corner widgets path edit shows on the open path: one inside each corner
|
|
61
|
+
* anchor, at the middle of its cut, pushed a fixed distance further in on
|
|
62
|
+
* screen so that it clears the anchor square at a zero radius. The overlay
|
|
63
|
+
* paints it and the hit-test presses it, as `corner:N`, from this one
|
|
64
|
+
* placement.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
/** Chrome-caps id the corner widgets are drawn and hit-tested under. On by
|
|
68
|
+
* default. */
|
|
69
|
+
declare const PATH_CORNERS_CHROME_ID = "path-edit.corners";
|
|
70
|
+
/** Screen distance from the middle of a corner's cut to its widget. */
|
|
71
|
+
declare const CORNER_WIDGET_STANDOFF_PX = 14;
|
|
72
|
+
/** The corner anchors of `path` that show a widget. */
|
|
73
|
+
declare function cornerWidgetFrames(path: PolygonPath): CornerFrame[];
|
|
74
|
+
/** How the widgets are drawn. */
|
|
75
|
+
interface CornerWidgetStyle {
|
|
76
|
+
/** Default: path edit's anchor fill. */
|
|
77
|
+
fill?: string;
|
|
78
|
+
/** Default: path edit's anchor stroke. */
|
|
79
|
+
stroke?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The widget of every corner anchor of `path`, in screen space: a small
|
|
83
|
+
* square whose corner toward the anchor is cut in the corner's shape. A
|
|
84
|
+
* corner with no spec draws as round, the shape a drag gives it.
|
|
85
|
+
*/
|
|
86
|
+
declare function cornerWidgetCommands(path: PolygonPath, view: View, style?: CornerWidgetStyle): DrawCommand[];
|
|
87
|
+
/** The corner widgets as a path-edit extension: drawn, and pressed as
|
|
88
|
+
* `corner:N`, while chrome-caps shows {@link PATH_CORNERS_CHROME_ID}. */
|
|
89
|
+
declare function createCornerWidgetsExtension(style?: CornerWidgetStyle): PathEditExtension;
|
|
90
|
+
|
|
69
91
|
/**
|
|
70
92
|
* The small marks the path-edit overlay draws for a path's constraints, in
|
|
71
93
|
* screen pixels, and where a click finds them: a letter beside a horizontal
|
|
72
94
|
* or vertical segment, paired strokes beside parallel ones, a foot beside
|
|
73
95
|
* perpendicular ones, ticks across equal ones, a dimension bar beside a fixed
|
|
74
|
-
* length, a pin by a fixed anchor,
|
|
96
|
+
* length, a pin by a fixed anchor, a ring by coincident ones, a line
|
|
97
|
+
* touching a circle by a tangent one, and a dot on a line by one held on a
|
|
98
|
+
* segment. Marks sit
|
|
75
99
|
* on the inside of the shape, toward the centroid of its anchors, so a click
|
|
76
100
|
* on one lands on the shape rather than on empty canvas.
|
|
77
101
|
*/
|
|
@@ -84,6 +108,72 @@ interface ConstraintGlyphStyle {
|
|
|
84
108
|
conflictStroke: string;
|
|
85
109
|
}
|
|
86
110
|
|
|
111
|
+
/** Angle snapping for a control-handle drag. */
|
|
112
|
+
interface HandleSnapOptions {
|
|
113
|
+
/** Snap to every multiple of this many degrees. Default 45; 0 turns the
|
|
114
|
+
* steps off and leaves only the opposite handle. */
|
|
115
|
+
stepDeg?: number;
|
|
116
|
+
/** How near, in degrees, the handle must come to an angle to snap. Read
|
|
117
|
+
* by the drag as it starts. Default 6. */
|
|
118
|
+
reachDeg?: number;
|
|
119
|
+
/** Also snap onto the line through the anchor's other handle. Default true. */
|
|
120
|
+
opposite?: boolean;
|
|
121
|
+
}
|
|
122
|
+
/** Options, or a thunk read on every move: null or undefined from it leaves
|
|
123
|
+
* the handle unsnapped. */
|
|
124
|
+
type HandleSnapOptionsInput = HandleSnapOptions | (() => HandleSnapOptions | null | undefined);
|
|
125
|
+
/**
|
|
126
|
+
* A handle drag's angle targets: the multiples of `stepDeg` either side of
|
|
127
|
+
* the handle, and the angle that puts it in line with the anchor's other
|
|
128
|
+
* handle, which the drag brings as `also.anchors`, ahead of a step it ties
|
|
129
|
+
* with. Each draws its line.
|
|
130
|
+
*/
|
|
131
|
+
declare function handleSnapSource(options?: HandleSnapOptionsInput): SnapSource;
|
|
132
|
+
/**
|
|
133
|
+
* Handle snapping as a path-edit extension: each control-handle drag runs a
|
|
134
|
+
* `'handle'` session on the canvas's `snap` dep, in polar coordinates about
|
|
135
|
+
* its anchor, and the handle keeps the length the pointer and the locks give
|
|
136
|
+
* it. A held angle lock holds the angle; a held length lock keeps the length
|
|
137
|
+
* while the angle snaps. The angles come from {@link handleSnapSource}, which
|
|
138
|
+
* `createHandleSnapPreset` registers beside it.
|
|
139
|
+
*/
|
|
140
|
+
declare function createHandleSnapExtension(options?: HandleSnapOptionsInput): PathEditExtension;
|
|
141
|
+
|
|
142
|
+
/** How far soft selection reaches, and how it fades. */
|
|
143
|
+
interface SoftSelectionOptions {
|
|
144
|
+
/** How far along the path the influence reaches, in screen pixels. */
|
|
145
|
+
radiusPx: number;
|
|
146
|
+
/** How the influence fades over the radius. Default `'smooth'`. */
|
|
147
|
+
falloff?: SoftFalloff;
|
|
148
|
+
/** Told each radius the wheel scrubs to, so a host can keep it for the next drag. */
|
|
149
|
+
onRadius?: (radiusPx: number) => void;
|
|
150
|
+
}
|
|
151
|
+
/** Soft selection as a path-edit extension. `options` is read as each anchor
|
|
152
|
+
* drag starts; null or undefined leaves that drag hard. */
|
|
153
|
+
declare function createSoftSelectionExtension(options: () => SoftSelectionOptions | null | undefined): PathEditExtension;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Which way the open path runs, drawn over it: an arrow at the middle of
|
|
157
|
+
* every segment and a ring round each subpath's start anchor.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
/** Chrome-caps id the direction arrows and start rings are drawn under. Off by default. */
|
|
161
|
+
declare const PATH_DIRECTION_CHROME_ID = "path-edit.direction";
|
|
162
|
+
/** How the direction marks are drawn. */
|
|
163
|
+
interface PathDirectionStyle {
|
|
164
|
+
/** Color of the arrows and the start rings. */
|
|
165
|
+
color?: string;
|
|
166
|
+
/** Length of an arrow, tip to base, in screen pixels. */
|
|
167
|
+
arrowPx?: number;
|
|
168
|
+
/** Radius of a start ring, in screen pixels. */
|
|
169
|
+
ringPx?: number;
|
|
170
|
+
}
|
|
171
|
+
/** Draw commands for `set`'s direction arrows and start rings, in screen space. */
|
|
172
|
+
declare function directionCommands(set: AnchorSet, toScreen: (p: Point) => Point, style?: PathDirectionStyle): DrawCommand[];
|
|
173
|
+
/** The direction marks as a path-edit extension, drawn in `style` while
|
|
174
|
+
* chrome-caps shows {@link PATH_DIRECTION_CHROME_ID}. */
|
|
175
|
+
declare function createDirectionExtension(style?: PathDirectionStyle): PathEditExtension;
|
|
176
|
+
|
|
87
177
|
/**
|
|
88
178
|
* The package's behavior as `<SceneCanvas features>` presets: one per tool
|
|
89
179
|
* family, and `pathTools` for all of them. Each assumes core's `paths`
|
|
@@ -94,16 +184,41 @@ interface ConstraintGlyphStyle {
|
|
|
94
184
|
declare const simplifyBrushPreset: FeaturePreset;
|
|
95
185
|
/** The `handleLock.angle` and `handleLock.length` toggles. */
|
|
96
186
|
declare const handleLocksPreset: FeaturePreset;
|
|
187
|
+
/**
|
|
188
|
+
* Soft selection: dragging anchors in path edit also moves the anchors near
|
|
189
|
+
* them along the path, by a falloff over `options`' radius, read as each drag
|
|
190
|
+
* starts. The wheel scrubs the radius mid-drag. Null or undefined from
|
|
191
|
+
* `options` leaves a drag hard.
|
|
192
|
+
*/
|
|
193
|
+
declare function createSoftSelectionPreset(options: () => SoftSelectionOptions | null | undefined): FeaturePreset;
|
|
194
|
+
/**
|
|
195
|
+
* Handle snapping: a dragged control handle's angle snaps to steps and to the
|
|
196
|
+
* line through its anchor's other handle, as `options` says. A thunk is read
|
|
197
|
+
* every move, and null or undefined from it leaves the handle unsnapped.
|
|
198
|
+
*/
|
|
199
|
+
declare function createHandleSnapPreset(options?: HandleSnapOptionsInput): FeaturePreset;
|
|
200
|
+
/** Handle snapping every 45°, within 6°, and to the opposite handle. */
|
|
201
|
+
declare const handleSnapPreset: FeaturePreset;
|
|
97
202
|
/** Bridge, on whole paths and on two selected anchors. */
|
|
98
203
|
declare const bridgePreset: FeaturePreset;
|
|
99
204
|
/** `trimPath`, which `useTrimTool` binds. */
|
|
100
205
|
declare const trimPreset: FeaturePreset;
|
|
101
206
|
/** `extendToMeet`, which `useExtendTool` binds. */
|
|
102
207
|
declare const extendPreset: FeaturePreset;
|
|
208
|
+
/** Lengthen, a path-edit tool whose drag on an open end grows or trims the
|
|
209
|
+
* path from that end, and its toggle. */
|
|
210
|
+
declare const lengthenPreset: FeaturePreset;
|
|
103
211
|
/** `smudgeBrush`, which `useSmudgeBrushTool` binds. */
|
|
104
212
|
declare const smudgePreset: FeaturePreset;
|
|
105
213
|
/** Harmonize curvature. */
|
|
106
214
|
declare const harmonizePreset: FeaturePreset;
|
|
215
|
+
/** Anchor selection along the path: grow, shrink, every Nth, corners, smooth
|
|
216
|
+
* anchors, and the complement. */
|
|
217
|
+
declare const anchorSelectionPreset: FeaturePreset;
|
|
218
|
+
/** Resample, which spreads anchors evenly by arc length. */
|
|
219
|
+
declare const resamplePreset: FeaturePreset;
|
|
220
|
+
/** Add extremes, an anchor at each curve's leftmost, rightmost, top, and bottom. */
|
|
221
|
+
declare const addExtremesPreset: FeaturePreset;
|
|
107
222
|
/** The curvature comb over the open path, drawn as `options` says, read every
|
|
108
223
|
* frame. Off until chrome-caps shows `path-edit.comb`. */
|
|
109
224
|
declare function createCurvatureCombPreset(options?: () => PathEditCombOptions | undefined): FeaturePreset;
|
|
@@ -123,12 +238,36 @@ declare const balancePreset: FeaturePreset;
|
|
|
123
238
|
declare function createConstraintsPreset(style?: Partial<ConstraintGlyphStyle>): FeaturePreset;
|
|
124
239
|
/** Path constraints with their default colors. */
|
|
125
240
|
declare const constraintsPreset: FeaturePreset;
|
|
241
|
+
/**
|
|
242
|
+
* Corner shape: a widget inside each corner anchor of the open path, drawn in
|
|
243
|
+
* `style`, whose drag sets the corner's radius (`editCorner`), and the
|
|
244
|
+
* commands on the selected corners (`setCorners`, `cycleCornerShape`). The
|
|
245
|
+
* widgets show while chrome-caps shows `path-edit.corners`, which is on by
|
|
246
|
+
* default. It refines `paths`, so a widget's drag goes ahead of the marquee.
|
|
247
|
+
*/
|
|
248
|
+
declare function createCornerShapePreset(style?: CornerWidgetStyle): FeaturePreset;
|
|
249
|
+
/** Corner shape with path edit's anchor colors. */
|
|
250
|
+
declare const cornerShapePreset: FeaturePreset;
|
|
251
|
+
/**
|
|
252
|
+
* Where a path starts and which way it runs: `setPathStart` and
|
|
253
|
+
* `reversePath`, and arrows and start rings over the open path, drawn in
|
|
254
|
+
* `style`. The marks are off until chrome-caps shows `path-edit.direction`.
|
|
255
|
+
*/
|
|
256
|
+
declare function createPathStructurePreset(style?: PathDirectionStyle): FeaturePreset;
|
|
257
|
+
/** Path start and direction with the marks' default look. */
|
|
258
|
+
declare const pathStructurePreset: FeaturePreset;
|
|
259
|
+
/** `convertSegments` and `convertSegmentAt`, turning segments straight or
|
|
260
|
+
* curved. It refines `paths`, so a segment's Shift+double-click goes ahead
|
|
261
|
+
* of entering path edit. */
|
|
262
|
+
declare const segmentTypePreset: FeaturePreset;
|
|
126
263
|
/** Blend, Bend along, and Repeat along, live, and the actions that edit and
|
|
127
264
|
* expand them. The scene must hold `withPathEffectsRegistry`'s derivations. */
|
|
128
265
|
declare const pathEffectsPreset: FeaturePreset;
|
|
129
266
|
/** `expandWarp` and `configureWarp`; the warp tools bring their own drags. */
|
|
130
267
|
declare const warpPreset: FeaturePreset;
|
|
131
|
-
/** Every preset above, the comb, balance,
|
|
268
|
+
/** Every preset above, spiro curves, the comb, balance, constraints, path
|
|
269
|
+
* direction, and corner shape with their defaults — except soft selection and
|
|
270
|
+
* handle snapping, which change what every anchor or handle drag does. */
|
|
132
271
|
declare const pathTools: FeaturePreset;
|
|
133
272
|
|
|
134
273
|
/**
|
|
@@ -145,7 +284,9 @@ interface ConstrainAnchorsParams {
|
|
|
145
284
|
}
|
|
146
285
|
/**
|
|
147
286
|
* The constraints of `kind` that `anchors`, in the order they were selected,
|
|
148
|
-
* ask for: each anchor for `fixed`; each
|
|
287
|
+
* ask for: each anchor for `fixed`; each anchor with both handles for
|
|
288
|
+
* `tangent`; for `onPath`, three anchors, the first held on the segment the
|
|
289
|
+
* other two end; each consecutive pair for `horizontal`,
|
|
149
290
|
* `vertical`, `length`, and `coincident`; and for the kinds relating two
|
|
150
291
|
* segments, three anchors as two segments sharing the middle one or four as
|
|
151
292
|
* two pairs. Empty when the anchors cannot make that kind.
|
|
@@ -176,6 +317,54 @@ declare const unconstrainAnchorsAction: Action & {
|
|
|
176
317
|
requires: string[];
|
|
177
318
|
};
|
|
178
319
|
|
|
320
|
+
/** The path-edit tool under which a drag on an open end lengthens the path. */
|
|
321
|
+
declare const LENGTHEN_TOOL = "lengthen";
|
|
322
|
+
/** Params `lengthenPath` reads on every move. */
|
|
323
|
+
interface LengthenPathParams {
|
|
324
|
+
/** How an unmodified drag grows the end; Shift picks the other. Default `'tangent'`. */
|
|
325
|
+
mode?: LengthenMode;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Lengthen, the path-edit tool's drag. While path edit's `lengthen` tool is
|
|
329
|
+
* on, dragging an open path's end anchor lengthens the path from that end
|
|
330
|
+
* (`lengthenPathEnd`): straight along its end tangent, or along an arc with
|
|
331
|
+
* the curvature the end has. Dragging back into the path shortens it along
|
|
332
|
+
* itself. The `mode` param (`'tangent'`, the default, or `'curvature'`) picks
|
|
333
|
+
* which, and Shift picks the other; both are read on every move. One undo
|
|
334
|
+
* step per drag. With the tool off, a drag on the anchor is `editAnchors`'
|
|
335
|
+
* and moves it.
|
|
336
|
+
*/
|
|
337
|
+
declare const lengthenPathAction: Action & {
|
|
338
|
+
requires: string[];
|
|
339
|
+
};
|
|
340
|
+
/** The bar toggle for Lengthen: `pathEditTool.lengthen`. */
|
|
341
|
+
declare const lengthenToolAction: Action & {
|
|
342
|
+
requires: string[];
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
/** What the `resamplePath` action reads from its params. */
|
|
346
|
+
type ResamplePathParams = {
|
|
347
|
+
/** Anchors in the result. 0 or absent keeps the count the path has. */
|
|
348
|
+
count?: number;
|
|
349
|
+
/** Distance between anchors along the path; overrides `count` when above 0. */
|
|
350
|
+
spacing?: number;
|
|
351
|
+
/** Hold corner anchors where they are. Default `true`. */
|
|
352
|
+
keepCorners?: boolean;
|
|
353
|
+
/** How far the result may stray from the original. Default 0.5. */
|
|
354
|
+
tolerance?: number;
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* Redistribute each selected path's anchors evenly by arc length
|
|
358
|
+
* (`resamplePath`), to `params.count` anchors or at `params.spacing`, with
|
|
359
|
+
* corners held unless `params.keepCorners` is false, and curves refitted
|
|
360
|
+
* within `params.tolerance` of the original ({@link ResamplePathParams}).
|
|
361
|
+
* Ongoing: `begin` previews it, each update with new params recomputes it,
|
|
362
|
+
* and committing writes one undo entry.
|
|
363
|
+
*/
|
|
364
|
+
declare const resamplePathAction: _weasel_js_routing.Action & {
|
|
365
|
+
requires: string[];
|
|
366
|
+
};
|
|
367
|
+
|
|
179
368
|
/** The path-edit tool under which a plain drag brushes. */
|
|
180
369
|
declare const SIMPLIFY_BRUSH_TOOL = "simplifyBrush";
|
|
181
370
|
/** The brush's radius on screen when no param names one. */
|
|
@@ -225,7 +414,7 @@ interface SmudgeBrushParams {
|
|
|
225
414
|
strength?: number;
|
|
226
415
|
}
|
|
227
416
|
/**
|
|
228
|
-
*
|
|
417
|
+
* A drag that pushes the outline of every selected path along with
|
|
229
418
|
* the pointer (`smudgePath` in `@weasel-js/geom`). Each pointer move is one dab from
|
|
230
419
|
* where the last one ended: points under the brush move with it, most at its center
|
|
231
420
|
* and not at all at its rim, and a long segment the brush meets gets anchors added
|
|
@@ -279,8 +468,9 @@ declare function withoutPathWarp<T>(data: T): T;
|
|
|
279
468
|
/**
|
|
280
469
|
* The warp `node` holds and its frame in world space, or null when it holds
|
|
281
470
|
* none or the one it holds no longer reproduces its geometry. A node whose
|
|
282
|
-
* stored path was
|
|
283
|
-
*
|
|
471
|
+
* stored path was rewritten by an affine map since — a polygon pose moved,
|
|
472
|
+
* resized or rotated, which rewrites its coordinates — still resolves: the
|
|
473
|
+
* map is recovered from the two sets of points and replaces `frame`.
|
|
284
474
|
*/
|
|
285
475
|
declare function resolvePathWarp(node: EditableShape | null | undefined): ResolvedPathWarp | null;
|
|
286
476
|
|
|
@@ -339,6 +529,11 @@ type SettingsOf<E> = {
|
|
|
339
529
|
type BlendParams = Omit<SettingsOf<BlendEffect>, 'reverse'> & {
|
|
340
530
|
reverse?: boolean | 'auto';
|
|
341
531
|
};
|
|
532
|
+
/** Either field left out keeps that part of each selected corner. */
|
|
533
|
+
type SetCornersParams = {
|
|
534
|
+
shape: CornerShape;
|
|
535
|
+
radius: number;
|
|
536
|
+
};
|
|
342
537
|
type EditPathEffectParams = BlendParams & SettingsOf<BendAlongEffect> & SettingsOf<RepeatAlongEffect> & {
|
|
343
538
|
ids?: readonly string[];
|
|
344
539
|
};
|
|
@@ -350,12 +545,19 @@ declare module '@weasel-js/routing' {
|
|
|
350
545
|
editPathEffect: EditPathEffectParams;
|
|
351
546
|
simplifyBrush: SimplifyBrushParams;
|
|
352
547
|
smudgeBrush: SmudgeBrushParams;
|
|
548
|
+
lengthenPath: LengthenPathParams;
|
|
353
549
|
bridgePaths: {
|
|
354
550
|
tension?: number;
|
|
355
551
|
};
|
|
356
552
|
bridgeAnchors: {
|
|
357
553
|
tension?: number;
|
|
358
554
|
};
|
|
555
|
+
setSpiroKind: {
|
|
556
|
+
kind?: SpiroKind;
|
|
557
|
+
};
|
|
558
|
+
'spiro.placePoint': {
|
|
559
|
+
kind?: SpiroKind;
|
|
560
|
+
};
|
|
359
561
|
constrainAnchors: ConstrainAnchorsParams;
|
|
360
562
|
unconstrainAnchors: {
|
|
361
563
|
kind?: PathConstraintKind;
|
|
@@ -367,6 +569,17 @@ declare module '@weasel-js/routing' {
|
|
|
367
569
|
configureWarp: WarpSettings & {
|
|
368
570
|
kind?: WarpKind;
|
|
369
571
|
};
|
|
572
|
+
convertSegments: {
|
|
573
|
+
to?: SegmentType;
|
|
574
|
+
};
|
|
575
|
+
convertSegmentAt: {
|
|
576
|
+
to?: SegmentType;
|
|
577
|
+
};
|
|
578
|
+
selectEveryNthAnchor: {
|
|
579
|
+
n?: number;
|
|
580
|
+
};
|
|
581
|
+
resamplePath: ResamplePathParams;
|
|
582
|
+
setCorners: SetCornersParams;
|
|
370
583
|
}
|
|
371
584
|
}
|
|
372
585
|
|
|
@@ -399,7 +612,7 @@ declare const DEFAULT_BRIDGE_TENSION = 0.4;
|
|
|
399
612
|
/** A bridge's `params.tension`, or the default. Negative reads as `0`. */
|
|
400
613
|
declare function bridgeTensionOf(params: Record<string, unknown> | undefined): number;
|
|
401
614
|
/**
|
|
402
|
-
*
|
|
615
|
+
* Bridge open paths: as `joinPaths`, but the gap is spanned by
|
|
403
616
|
* a curve leaving each end along the direction its path was heading, each
|
|
404
617
|
* handle `params.tension` times the gap long (default
|
|
405
618
|
* {@link DEFAULT_BRIDGE_TENSION}). Two paths become one. In path edit,
|
|
@@ -409,7 +622,7 @@ declare const bridgePathsAction: Action & {
|
|
|
409
622
|
requires: string[];
|
|
410
623
|
};
|
|
411
624
|
/**
|
|
412
|
-
*
|
|
625
|
+
* Bridge the two selected anchors, each the end of an open
|
|
413
626
|
* subpath, as `joinAnchors` does, but with a curve leaving each end along the
|
|
414
627
|
* direction its path was heading, each handle `params.tension` times the gap
|
|
415
628
|
* long (`bridgePaths`'s default when absent). The anchor selection is
|
|
@@ -430,7 +643,7 @@ declare function planTrim(deps: ActionDeps, params: unknown): {
|
|
|
430
643
|
result: TrimResult;
|
|
431
644
|
} | null;
|
|
432
645
|
/**
|
|
433
|
-
*
|
|
646
|
+
* Trim segment: remove the piece of the stroke under the press
|
|
434
647
|
* between the nearest crossings on either side — with any other node's
|
|
435
648
|
* outline, or with itself — as `trimPathAt` cuts it. The topmost stroke
|
|
436
649
|
* within `radiusPx` of the press (default 6) is the one trimmed; a stroke
|
|
@@ -444,7 +657,7 @@ declare const trimPathAction: Action & {
|
|
|
444
657
|
/** Extend to next path: carry an open end along its tangent until it meets a stroke. */
|
|
445
658
|
|
|
446
659
|
/**
|
|
447
|
-
*
|
|
660
|
+
* Extend to next path: carry each open end of the selected
|
|
448
661
|
* paths along its tangent to the first stroke it meets (`extendToMeet`). In
|
|
449
662
|
* path edit, the selected end anchors of the edited path, or all its open
|
|
450
663
|
* ends when none is selected. Given a press (`pressX`, `pressY`, as a click
|
|
@@ -463,6 +676,108 @@ declare const harmonizeAnchorsAction: _weasel_js_routing.Action & {
|
|
|
463
676
|
requires: string[];
|
|
464
677
|
};
|
|
465
678
|
|
|
679
|
+
/**
|
|
680
|
+
* Where a path starts and which way it runs: make the selected anchor its
|
|
681
|
+
* subpath's start, and reverse a path's direction. Both reorder anchors
|
|
682
|
+
* without moving them, and what a node keeps per anchor moves with them.
|
|
683
|
+
*/
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Make the selected anchor where its subpath starts. A closed
|
|
687
|
+
* subpath turns to start there; an open one can start only at an end, so its
|
|
688
|
+
* last anchor reverses it (`setSubpathStart`). The anchor stays selected.
|
|
689
|
+
*/
|
|
690
|
+
declare const setPathStartAction: Action & {
|
|
691
|
+
requires: string[];
|
|
692
|
+
};
|
|
693
|
+
/**
|
|
694
|
+
* Run paths the other way, keeping their shape. In path edit it
|
|
695
|
+
* reverses the subpaths holding the selected anchors — every subpath when
|
|
696
|
+
* none is selected — and the selection follows its anchors. Otherwise it
|
|
697
|
+
* reverses every selected path whole, in one undo entry. A closed subpath
|
|
698
|
+
* keeps its start; an open one starts where it ended (`reverseSubpaths`).
|
|
699
|
+
*/
|
|
700
|
+
declare const reversePathAction: Action & {
|
|
701
|
+
requires: string[];
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Make segments of the path being edited straight or curved, in place
|
|
706
|
+
* (`convertSegments`): the selected segments from the keyboard, or the one
|
|
707
|
+
* under a Shift+double-click.
|
|
708
|
+
*/
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Convert the selected segments — those whose two ends are both
|
|
712
|
+
* selected anchors. `params.to` `'line'` straightens them, `'curve'` curves
|
|
713
|
+
* them with handles at their thirds so they keep their shape, and no `to`
|
|
714
|
+
* (Shift+C) curves them all when any is straight and straightens them
|
|
715
|
+
* otherwise.
|
|
716
|
+
*/
|
|
717
|
+
declare const convertSegmentsAction: Action & {
|
|
718
|
+
requires: string[];
|
|
719
|
+
};
|
|
720
|
+
/**
|
|
721
|
+
* Shift+double-click a segment of the path being edited to flip
|
|
722
|
+
* it between straight and curved. Off every segment the click falls through.
|
|
723
|
+
*/
|
|
724
|
+
declare const convertSegmentAtAction: Action & {
|
|
725
|
+
requires: string[];
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Anchor selection along the path in path edit: grow or shrink it by one
|
|
730
|
+
* anchor, every Nth anchor, corners or smooth anchors, and the complement.
|
|
731
|
+
* They change which anchors are selected and nothing else, so none of them
|
|
732
|
+
* is an undo step.
|
|
733
|
+
*/
|
|
734
|
+
|
|
735
|
+
/** The group every action here is in, which an `ActionBar` can show. */
|
|
736
|
+
declare const ANCHOR_SELECTION_GROUP = "anchorSelection";
|
|
737
|
+
/** Add each selected anchor's neighbors along the path. `]`. */
|
|
738
|
+
declare const growAnchorSelectionAction: Action & {
|
|
739
|
+
requires: string[];
|
|
740
|
+
};
|
|
741
|
+
/** Drop the anchors at the ends of each selected run. `[`. */
|
|
742
|
+
declare const shrinkAnchorSelectionAction: Action & {
|
|
743
|
+
requires: string[];
|
|
744
|
+
};
|
|
745
|
+
/**
|
|
746
|
+
* Select every `params.n`th anchor (default 2) along each subpath, counting
|
|
747
|
+
* from its first selected anchor, or from the start of every subpath when
|
|
748
|
+
* none is selected. Alt+N.
|
|
749
|
+
*/
|
|
750
|
+
declare const selectEveryNthAnchorAction: Action & {
|
|
751
|
+
requires: string[];
|
|
752
|
+
};
|
|
753
|
+
/** Select every corner anchor of the edited path. Alt+C. */
|
|
754
|
+
declare const selectCornerAnchorsAction: Action & {
|
|
755
|
+
requires: string[];
|
|
756
|
+
};
|
|
757
|
+
/** Select every smooth anchor of the edited path. Alt+M. */
|
|
758
|
+
declare const selectSmoothAnchorsAction: Action & {
|
|
759
|
+
requires: string[];
|
|
760
|
+
};
|
|
761
|
+
/** Select the anchors that are not selected, and only those. Alt+I. */
|
|
762
|
+
declare const invertAnchorSelectionAction: Action & {
|
|
763
|
+
requires: string[];
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Add extremes in path edit: an anchor at each turn of a curved segment, in x
|
|
768
|
+
* and in y, with the shape left as it was.
|
|
769
|
+
*/
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Split the curved segments of the edited path at their x and y extremes:
|
|
773
|
+
* those whose two ends are both selected, or every one while no anchor is.
|
|
774
|
+
* The selected anchors stay selected, and the new ones join them. Alt+X.
|
|
775
|
+
* Enabled only where it would add an anchor.
|
|
776
|
+
*/
|
|
777
|
+
declare const addExtremeAnchorsAction: Action & {
|
|
778
|
+
requires: string[];
|
|
779
|
+
};
|
|
780
|
+
|
|
466
781
|
/**
|
|
467
782
|
* The balance grip on each curved segment of the path being edited, midway
|
|
468
783
|
* along the line joining its two handle tips:
|
|
@@ -502,9 +817,9 @@ declare const PATH_EFFECTS_GROUP = "pathEffects";
|
|
|
502
817
|
/**
|
|
503
818
|
* Steps between the first two selected shapes, in the order they were
|
|
504
819
|
* selected: `params.steps` of them, each shape, fill, stroke and turn
|
|
505
|
-
* interpolated
|
|
506
|
-
*
|
|
507
|
-
* `BlendEffect`'s.
|
|
820
|
+
* interpolated, laid along a third selected path where there is one. The
|
|
821
|
+
* blend is live — editing a source moves its steps — and goes just under the
|
|
822
|
+
* upper of the first two. Its other params are `BlendEffect`'s.
|
|
508
823
|
*/
|
|
509
824
|
declare const blendAction: Action & {
|
|
510
825
|
requires: string[];
|
|
@@ -572,6 +887,49 @@ declare const expandWarpAction: Action;
|
|
|
572
887
|
*/
|
|
573
888
|
declare const configureWarpAction: Action;
|
|
574
889
|
|
|
890
|
+
/**
|
|
891
|
+
* Corner shape in path edit: drag a corner's widget to set its radius.
|
|
892
|
+
*
|
|
893
|
+
* A drag measures how far the pointer moves along the corner's bisector and
|
|
894
|
+
* turns that into a cut along the edges, clamped to the room the neighboring
|
|
895
|
+
* corners leave. Pressing the widget of a selected anchor gives every
|
|
896
|
+
* selected corner the same radius. The release commits one undo step.
|
|
897
|
+
*/
|
|
898
|
+
|
|
899
|
+
/** The shape a corner with no spec yet takes. */
|
|
900
|
+
declare const DEFAULT_CORNER_SHAPE: CornerShape;
|
|
901
|
+
/** Drag a corner widget to set the corner's radius. */
|
|
902
|
+
declare const editCornerAction: Action & {
|
|
903
|
+
requires: string[];
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* Commands on the corners of the anchors selected in path edit: set their
|
|
908
|
+
* shape or radius, or step their shape through the `corner-shape` keywords.
|
|
909
|
+
*/
|
|
910
|
+
|
|
911
|
+
/** The share of a corner's room that a shape given to a sharp corner cuts. */
|
|
912
|
+
declare const DEFAULT_CORNER_TRIM_SHARE = 0.25;
|
|
913
|
+
/**
|
|
914
|
+
* Set the selected corners' shape, radius, or both, from the `shape` (a
|
|
915
|
+
* keyword or a finite `superellipse()` parameter) and `radius` params; each
|
|
916
|
+
* is left alone when its param is absent, except that a shape given to a
|
|
917
|
+
* sharp corner also gives it a radius. A UI control's action: it has no
|
|
918
|
+
* default binding.
|
|
919
|
+
*/
|
|
920
|
+
declare const setCornersAction: Action & {
|
|
921
|
+
requires: string[];
|
|
922
|
+
};
|
|
923
|
+
/**
|
|
924
|
+
* Step the selected corners to the next `corner-shape` keyword, keeping
|
|
925
|
+
* their radius. Every one takes the keyword after the first selected
|
|
926
|
+
* corner's shape, so a mixed selection comes out alike, and a sharp corner
|
|
927
|
+
* gets a radius that shows it.
|
|
928
|
+
*/
|
|
929
|
+
declare const cycleCornerShapeAction: Action & {
|
|
930
|
+
requires: string[];
|
|
931
|
+
};
|
|
932
|
+
|
|
575
933
|
/** Options for a tool that acts on the stroke under a click. */
|
|
576
934
|
interface StrokeClickToolOptions {
|
|
577
935
|
/** Override the default keybinding. Pass `null` to omit. */
|
|
@@ -670,6 +1028,350 @@ declare function usePuppetTool(options?: UsePuppetToolOptions): WarpTool;
|
|
|
670
1028
|
* its controls through `affordance:layer:<id>`. */
|
|
671
1029
|
declare const warpLayerId: (kind: WarpKind) => string;
|
|
672
1030
|
|
|
1031
|
+
/**
|
|
1032
|
+
* Shape building: the selected paths cut into the faces their outlines bound,
|
|
1033
|
+
* then a pick of those faces united into one path, or deleted, as one undo step.
|
|
1034
|
+
*/
|
|
1035
|
+
|
|
1036
|
+
/** What a pick of faces does: unite them into one path, or delete them. */
|
|
1037
|
+
type ShapeBuilderMode = 'merge' | 'delete';
|
|
1038
|
+
/** One face of the selection: a connected region no outline crosses. */
|
|
1039
|
+
interface ShapeBuilderFace {
|
|
1040
|
+
path: PolygonPath;
|
|
1041
|
+
/** The topmost source covering the face, which a path made of it stands in for. */
|
|
1042
|
+
sourceId: NodeId;
|
|
1043
|
+
/** Set when that source's stroke went into the face: the paint it wears. */
|
|
1044
|
+
paint?: PathPaint;
|
|
1045
|
+
}
|
|
1046
|
+
/** The faces of the selection, and the commit that rebuilds it from a pick of them. */
|
|
1047
|
+
interface ShapeBuilderPlan {
|
|
1048
|
+
kind: 'faces';
|
|
1049
|
+
/** Back to front by the sources they cover, exclusives first. */
|
|
1050
|
+
faces: readonly ShapeBuilderFace[];
|
|
1051
|
+
/** The index of the face holding the world point, or -1. */
|
|
1052
|
+
faceAt(x: number, y: number): number;
|
|
1053
|
+
/**
|
|
1054
|
+
* Replace the selection with its faces, the `picked` ones united into one
|
|
1055
|
+
* path standing in for the source of the first one picked (`'merge'`) or
|
|
1056
|
+
* left out (`'delete'`). Every other face becomes a path of its own. One
|
|
1057
|
+
* undo step, and what it made is selected. Commits nothing for an empty pick.
|
|
1058
|
+
*/
|
|
1059
|
+
commit(picked: readonly number[], mode: ShapeBuilderMode): BooleanOpResult;
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* The faces the selected paths cut each other into, or why there are none.
|
|
1063
|
+
* Reads the adapter and changes nothing; the plan's `commit` writes.
|
|
1064
|
+
*/
|
|
1065
|
+
declare function planShapeBuilder(adapter: BooleansAdapter, opts?: BooleanOpOptions): ShapeBuilderPlan | Exclude<BooleanOpResult, {
|
|
1066
|
+
kind: 'applied';
|
|
1067
|
+
}>;
|
|
1068
|
+
/**
|
|
1069
|
+
* The faces a run of world points passes through, each once, in the order
|
|
1070
|
+
* the run enters them. `step` is the world distance between the samples
|
|
1071
|
+
* taken along each segment; a face narrower than it can be stepped over.
|
|
1072
|
+
*/
|
|
1073
|
+
declare function facesAlong(plan: Pick<ShapeBuilderPlan, 'faceAt'>, run: readonly {
|
|
1074
|
+
x: number;
|
|
1075
|
+
y: number;
|
|
1076
|
+
}[], step: number): number[];
|
|
1077
|
+
|
|
1078
|
+
/** Options for `useShapeBuilderTool`. */
|
|
1079
|
+
interface UseShapeBuilderToolOptions {
|
|
1080
|
+
/** Override the default keybinding (`{ key: 'M', shift: true }`). Pass `null` to omit. */
|
|
1081
|
+
keybinding?: ToolKeybinding | null;
|
|
1082
|
+
/** What a stroked path gives the faces. Default `'unfilled'`, as the
|
|
1083
|
+
* Pathfinder actions: an unfilled stroke counts as the region it covers. */
|
|
1084
|
+
strokes?: BooleanStrokes;
|
|
1085
|
+
/** What a drag or a click does without Alt: unite the faces (`'merge'`, the
|
|
1086
|
+
* default) or delete them. With Alt it does the other. Read on every gesture. */
|
|
1087
|
+
mode?: ShapeBuilderMode;
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Shape builder. With two or more paths selected, the faces their outlines cut
|
|
1091
|
+
* each other into are what the tool works on: the face under the pointer is
|
|
1092
|
+
* shown, a drag unites every face it passes through into one path wearing the
|
|
1093
|
+
* paint of the first, and an Alt-drag deletes them (the other way round under
|
|
1094
|
+
* `mode: 'delete'`). A click takes the one face. Every face not taken becomes a path of its own, and each gesture is
|
|
1095
|
+
* one undo step. With fewer than two selected, a drag marquee-selects.
|
|
1096
|
+
*
|
|
1097
|
+
* It reads the `booleansAdapter` dep the Pathfinder actions do.
|
|
1098
|
+
*/
|
|
1099
|
+
declare function useShapeBuilderTool(options?: UseShapeBuilderToolOptions): Tool;
|
|
1100
|
+
|
|
1101
|
+
/** Options for `useGirthTool`. */
|
|
1102
|
+
interface UseGirthToolOptions {
|
|
1103
|
+
/** Override the default keybinding (`{ key: 'W', shift: true }`). Pass `null` to omit. */
|
|
1104
|
+
keybinding?: ToolKeybinding | null;
|
|
1105
|
+
/** Screen px around a stroke's edge within which a press takes hold of it,
|
|
1106
|
+
* and along the path within which it takes the anchor there rather than
|
|
1107
|
+
* inserting one. Default 6. */
|
|
1108
|
+
reach?: number;
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* Girth tool: shapes a stroke's width along its length, into its
|
|
1112
|
+
* `vertexWidths`, by dragging the stroke's edges. Hovering near either edge
|
|
1113
|
+
* marks the grab point on it and the width point a press there moves: the
|
|
1114
|
+
* anchor at that spot, or a new one inserted between two, keeping the path's
|
|
1115
|
+
* shape. Dragging moves the grabbed edge along the path's normal, the other
|
|
1116
|
+
* edge mirroring it so the width stays centered; inward pinches it, down to
|
|
1117
|
+
* zero. With Alt held only the grabbed edge moves, writing a `{ left, right }`
|
|
1118
|
+
* pair. Either drag is live and one undo entry. Alt-click on a width point
|
|
1119
|
+
* clears it, so it takes the stroke's own width. The last stroke touched shows
|
|
1120
|
+
* its anchors, with a line across the stroke at each that has a width.
|
|
1121
|
+
*/
|
|
1122
|
+
declare function useGirthTool(options?: UseGirthToolOptions): Tool;
|
|
1123
|
+
|
|
1124
|
+
/** What the Girth tool's overlay shows, in world space: the anchors of the
|
|
1125
|
+
* stroke last hovered or pressed on, each with its unit normal toward its
|
|
1126
|
+
* right edge and its `vertexWidths` entry (`NaN` for none), and, over an
|
|
1127
|
+
* edge, the grab point on it and the width point a press there moves. */
|
|
1128
|
+
interface GirthFocus {
|
|
1129
|
+
anchors: readonly Point[];
|
|
1130
|
+
normals: readonly Point[];
|
|
1131
|
+
widths: readonly VertexWidth[];
|
|
1132
|
+
/** The stroke's own width, which an unset entry takes. */
|
|
1133
|
+
fallback: number;
|
|
1134
|
+
grab?: {
|
|
1135
|
+
edge: Point;
|
|
1136
|
+
at: Point;
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
/** The Girth tool's own state, shared by its actions and its overlay. */
|
|
1140
|
+
interface GirthEnv {
|
|
1141
|
+
focus(): GirthFocus | null;
|
|
1142
|
+
setFocus(next: GirthFocus | null): void;
|
|
1143
|
+
/** Screen px around a stroke's edge within which a press takes hold of it,
|
|
1144
|
+
* and along the path within which it takes the anchor there. */
|
|
1145
|
+
reachPx(): number;
|
|
1146
|
+
}
|
|
1147
|
+
/** Id of the action that drags a stroke's edge. */
|
|
1148
|
+
declare const GIRTH_DRAG_ID = "girth.drag";
|
|
1149
|
+
/** Id of the action that clears the width point under a click. */
|
|
1150
|
+
declare const GIRTH_CLEAR_ID = "girth.clear";
|
|
1151
|
+
/** Id of the action that marks the edge under a hover. */
|
|
1152
|
+
declare const GIRTH_HOVER_ID = "girth.hover";
|
|
1153
|
+
/** Id of the action that drops the hover mark when the pointer leaves. */
|
|
1154
|
+
declare const GIRTH_UNHOVER_ID = "girth.unhover";
|
|
1155
|
+
/**
|
|
1156
|
+
* The Girth tool's actions, which write a stroke's `vertexWidths`.
|
|
1157
|
+
* `girth.drag` takes hold of the stroke edge under the press, at the anchor
|
|
1158
|
+
* there or at one it inserts, shape kept, between two. The edge follows the
|
|
1159
|
+
* pointer along the path's normal, the other edge mirroring it so the width
|
|
1160
|
+
* stays centered; with Alt held only the grabbed edge moves, which writes a
|
|
1161
|
+
* `{ left, right }` pair. Either is live, and one undo entry. `girth.clear`
|
|
1162
|
+
* clears the width point under a click, so it takes the stroke's own width
|
|
1163
|
+
* again. `girth.hover` and `girth.unhover` show and hide the grab point under
|
|
1164
|
+
* the pointer.
|
|
1165
|
+
*/
|
|
1166
|
+
declare function createGirthActions(env: GirthEnv): Action[];
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* A screen-space layer marking the width points of the stroke the Girth tool
|
|
1170
|
+
* last touched: a dot on each anchor, white where it has a width of its own,
|
|
1171
|
+
* with a line across the stroke from its left edge to its right. Over an
|
|
1172
|
+
* edge it adds the grab point on that edge, ringing the width point a press
|
|
1173
|
+
* there moves.
|
|
1174
|
+
*/
|
|
1175
|
+
declare function createGirthOverlay(source: {
|
|
1176
|
+
focus(): GirthFocus | null;
|
|
1177
|
+
subscribe(fn: () => void): () => void;
|
|
1178
|
+
}): RenderLayer<unknown>;
|
|
1179
|
+
|
|
1180
|
+
/**
|
|
1181
|
+
* What the Girth tool reads and writes: the stroke edge under a point, the
|
|
1182
|
+
* width point a press on it moves — inserting an anchor where the press falls
|
|
1183
|
+
* between two — and the per-vertex widths a drag leaves behind.
|
|
1184
|
+
*/
|
|
1185
|
+
|
|
1186
|
+
/** A stroked path node and its centerline in world space. */
|
|
1187
|
+
interface WidthTarget {
|
|
1188
|
+
id: NodeId;
|
|
1189
|
+
node: SceneNode<unknown, string, unknown>;
|
|
1190
|
+
path: PolygonPath;
|
|
1191
|
+
stroke: Stroke;
|
|
1192
|
+
/** The stroke's own width in world units: what an unset entry takes. */
|
|
1193
|
+
fallback: number;
|
|
1194
|
+
}
|
|
1195
|
+
/** A stroke edge found under a point, and the width point a press there
|
|
1196
|
+
* moves: anchor `index`, or one inserted at `at` when `index` is null. */
|
|
1197
|
+
interface WidthEdgeHit {
|
|
1198
|
+
target: WidthTarget;
|
|
1199
|
+
edge: StrokeEdgeHit;
|
|
1200
|
+
index: number | null;
|
|
1201
|
+
at: Point;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* The width point a drag edits, on a node's geometry as the press leaves it:
|
|
1205
|
+
* `path` gained an anchor at `index` when the press fell between two.
|
|
1206
|
+
*/
|
|
1207
|
+
interface WidthGrip {
|
|
1208
|
+
target: WidthTarget;
|
|
1209
|
+
/** The world path, with the inserted anchor if there is one. */
|
|
1210
|
+
path: PolygonPath;
|
|
1211
|
+
/** One entry per anchor of `path`; `NaN` takes the stroke's own width. */
|
|
1212
|
+
widths: VertexWidth[];
|
|
1213
|
+
index: number;
|
|
1214
|
+
at: Point;
|
|
1215
|
+
inserted: boolean;
|
|
1216
|
+
/** The edge taken hold of, and the unit normal it moves along. */
|
|
1217
|
+
side: StrokeSide;
|
|
1218
|
+
normal: Point;
|
|
1219
|
+
/** Each edge's distance from the path at the width point, before the drag. */
|
|
1220
|
+
start: HalfWidths;
|
|
1221
|
+
/** What the nib multiplies a stored width by there, so a drag moves the
|
|
1222
|
+
* edge as drawn. */
|
|
1223
|
+
factor: number;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
/** Spiro curves: path edit edits a spiro node's points and solves the curve
|
|
1227
|
+
* again through them (`spiroRepresentation`), `setSpiroKind` sets the kind
|
|
1228
|
+
* of the selected points, and `releaseSpiro` converts a spiro curve to an
|
|
1229
|
+
* ordinary path. `useSpiroTool` draws them. */
|
|
1230
|
+
declare const spiroPreset: FeaturePreset;
|
|
1231
|
+
|
|
1232
|
+
/** Options for {@link useSpiroTool}. */
|
|
1233
|
+
interface UseSpiroToolOptions {
|
|
1234
|
+
/** Select the new curve once it commits. Default `true`. */
|
|
1235
|
+
autoSelect?: boolean;
|
|
1236
|
+
/** Screen-px radius of "click the first point to close". Default `8`. */
|
|
1237
|
+
closeHitRadius?: number;
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Active-slot Tool that draws a spiro curve (`solveSpiro`) by placing its
|
|
1241
|
+
* on-curve points: each click places one, of the kind `params.kind` of the
|
|
1242
|
+
* `spiro.placePoint` action (default `'smooth'`; Alt-click places a corner),
|
|
1243
|
+
* and the preview solves the curve through the points and the cursor as it
|
|
1244
|
+
* moves. Clicking the first point of three or more closes the curve; Enter,
|
|
1245
|
+
* a double-click or Mod-click finishes it open; Backspace takes back the last
|
|
1246
|
+
* point and Escape discards them all, as does switching tools.
|
|
1247
|
+
*
|
|
1248
|
+
* The curve is inserted through the `insert` dep as a `'path'`, its spiro
|
|
1249
|
+
* form beside it on `data.representation`, so a consumer shapes the node by
|
|
1250
|
+
* overriding that dep. With `spiroPreset` on, path edit then edits its points
|
|
1251
|
+
* (`spiroRepresentation`).
|
|
1252
|
+
*/
|
|
1253
|
+
declare function useSpiroTool(options?: UseSpiroToolOptions): Tool;
|
|
1254
|
+
|
|
1255
|
+
/**
|
|
1256
|
+
* Commands on spiro curves (`spiroShape`): set the kind of the points
|
|
1257
|
+
* selected in path edit, and convert a spiro curve to an ordinary path.
|
|
1258
|
+
*/
|
|
1259
|
+
|
|
1260
|
+
/**
|
|
1261
|
+
* @experimental In path edit on a spiro curve, give the selected points the
|
|
1262
|
+
* kind `params.kind` (default `'smooth'`) and solve the curve again. One
|
|
1263
|
+
* variant per kind.
|
|
1264
|
+
*/
|
|
1265
|
+
declare const setSpiroKindAction: Action & {
|
|
1266
|
+
requires: string[];
|
|
1267
|
+
};
|
|
1268
|
+
/**
|
|
1269
|
+
* @experimental Convert the selected spiro curves, or the one in path edit, to
|
|
1270
|
+
* ordinary paths: the curve stays as drawn and its anchors and handles become
|
|
1271
|
+
* editable, while the spiro points stop being solved. Path edit's anchor
|
|
1272
|
+
* selection is cleared, since the anchors it numbered are gone.
|
|
1273
|
+
*/
|
|
1274
|
+
declare const releaseSpiroAction: Action & {
|
|
1275
|
+
requires: string[];
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* Spiro curves in path edit: a spiro node is edited through its straight-sided
|
|
1280
|
+
* control path, whose anchors are the curve's points, and every edit solves
|
|
1281
|
+
* the curve again through them. Each point draws by its kind, and a press on
|
|
1282
|
+
* the curve between two points adds one there.
|
|
1283
|
+
*/
|
|
1284
|
+
|
|
1285
|
+
/** How path edit reads and writes a spiro form. */
|
|
1286
|
+
declare const spiroRepresentation: PathRepresentation;
|
|
1287
|
+
/** The path-edit extension carrying {@link spiroRepresentation}. */
|
|
1288
|
+
declare const spiroExtension: PathEditExtension;
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* How a spiro point is marked, by its kind: a circle for a smooth point, a
|
|
1292
|
+
* diamond for a g4 point, a square for a corner, and a half-disc for a point
|
|
1293
|
+
* beside a straight segment, its flat side toward the line.
|
|
1294
|
+
*/
|
|
1295
|
+
|
|
1296
|
+
/**
|
|
1297
|
+
* The marker shape of a spiro point of `kind`. A `left` point's line arrives
|
|
1298
|
+
* from its previous neighbor and a `right` point's leaves toward its next,
|
|
1299
|
+
* both in the same screen space; without that neighbor the half-disc faces
|
|
1300
|
+
* right.
|
|
1301
|
+
*/
|
|
1302
|
+
declare function spiroMarker(kind: SpiroKind): AnchorMarkerShape;
|
|
1303
|
+
|
|
1304
|
+
/** What the spiro tool has placed, as the preview reads it each frame. */
|
|
1305
|
+
interface SpiroPreviewState {
|
|
1306
|
+
points: readonly SpiroPoint[];
|
|
1307
|
+
/** Where the next point would go, or null while the pointer is away. */
|
|
1308
|
+
cursor: SpiroPoint | null;
|
|
1309
|
+
/** True while a click would close the curve on its first point. */
|
|
1310
|
+
closeHint: boolean;
|
|
1311
|
+
}
|
|
1312
|
+
/** Options for {@link createSpiroPreviewLayer}. */
|
|
1313
|
+
interface CreateSpiroPreviewLayerOptions {
|
|
1314
|
+
state: () => SpiroPreviewState;
|
|
1315
|
+
/** The color the curve and markers are drawn in. */
|
|
1316
|
+
color?: string;
|
|
1317
|
+
}
|
|
1318
|
+
/** Render layer drawing the spiro tool's curve in progress; nothing while
|
|
1319
|
+
* no point is placed. */
|
|
1320
|
+
declare function createSpiroPreviewLayer(opts: CreateSpiroPreviewLayerOptions): RenderLayer<unknown>;
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* A spiro node: a path node whose `data.representation` is a spiro form,
|
|
1324
|
+
* saying its `data.path` is a solved spiro curve and which of the path's
|
|
1325
|
+
* anchors are the curve's points (`spiroToPath`). The path stays the geometry
|
|
1326
|
+
* every reader uses; path edit edits the points instead, through the
|
|
1327
|
+
* straight-sided control path, and each edit solves the curve again
|
|
1328
|
+
* (`spiroRepresentation`). Converting to a path drops the form.
|
|
1329
|
+
*/
|
|
1330
|
+
|
|
1331
|
+
/** The `kind` of a spiro form. */
|
|
1332
|
+
declare const SPIRO_FORM = "spiro";
|
|
1333
|
+
/** A spiro form, as `data.representation` holds it: each point's kind, and
|
|
1334
|
+
* the anchor of `data.path` it became. */
|
|
1335
|
+
type SpiroShape = {
|
|
1336
|
+
kind: typeof SPIRO_FORM;
|
|
1337
|
+
kinds: SpiroKind[];
|
|
1338
|
+
at: number[];
|
|
1339
|
+
};
|
|
1340
|
+
/** `form` as a spiro form, or null when it is not a well-formed one. */
|
|
1341
|
+
declare function asSpiro(form: unknown): SpiroShape | null;
|
|
1342
|
+
/** The spiro form a node's `data` holds, or `null`. */
|
|
1343
|
+
declare function spiroOf(data: unknown): SpiroShape | null;
|
|
1344
|
+
/** `data` without its spiro form: the curve as plain geometry. */
|
|
1345
|
+
declare function withoutSpiro<T>(data: T): T;
|
|
1346
|
+
/** The node data a solved spiro curve is stored as: its path, and the form
|
|
1347
|
+
* that says which anchors are points. */
|
|
1348
|
+
declare function spiroNodeData(contours: readonly SpiroContour[], like?: PolygonPath): {
|
|
1349
|
+
path: PolygonPath;
|
|
1350
|
+
representation: SpiroShape;
|
|
1351
|
+
};
|
|
1352
|
+
/** The contours `spiro` reads out of `path`, or null when it does not
|
|
1353
|
+
* describe it. */
|
|
1354
|
+
declare function spiroContours(path: PolygonPath, spiro: SpiroShape): SpiroContour[] | null;
|
|
1355
|
+
/** The straight-sided path through `spiro`'s points on `path`: what path
|
|
1356
|
+
* edit shows and moves. Null when `spiro` does not describe `path`. */
|
|
1357
|
+
declare function spiroEditPath(path: PolygonPath, spiro: SpiroShape): PolygonPath | null;
|
|
1358
|
+
/**
|
|
1359
|
+
* The curve an edit of the control path makes, solved through its anchors:
|
|
1360
|
+
* `control` is the edited control path, `path` the curve it was edited from.
|
|
1361
|
+
* Each point keeps its kind (`spiroContoursFromControl`). Null when `spiro`
|
|
1362
|
+
* does not describe `path`.
|
|
1363
|
+
*/
|
|
1364
|
+
declare function respiro(path: PolygonPath, spiro: SpiroShape, control: PolygonPath): {
|
|
1365
|
+
path: PolygonPath;
|
|
1366
|
+
spiro: SpiroShape;
|
|
1367
|
+
} | null;
|
|
1368
|
+
/** The curve `path` makes with the points at `flatIndexes` set to `kind`. Null
|
|
1369
|
+
* when `spiro` does not describe `path`, or no kind changes. */
|
|
1370
|
+
declare function respiroWithKind(path: PolygonPath, spiro: SpiroShape, flatIndexes: Iterable<number>, kind: SpiroKind): {
|
|
1371
|
+
path: PolygonPath;
|
|
1372
|
+
spiro: SpiroShape;
|
|
1373
|
+
} | null;
|
|
1374
|
+
|
|
673
1375
|
/**
|
|
674
1376
|
* Path constraints in path edit: their marks on the open path, a click
|
|
675
1377
|
* selecting one, Delete removing it, and every edit finished so they hold.
|
|
@@ -682,14 +1384,118 @@ declare const CONSTRAINTS_EXTENSION_ID = "constraints";
|
|
|
682
1384
|
* entry, moving it the least that makes them all hold. When they cannot all
|
|
683
1385
|
* hold the path stays as it is and the list is stored all the same, the
|
|
684
1386
|
* conflict left for the marks to show. Clears the selected mark, since the
|
|
685
|
-
* list is renumbered.
|
|
1387
|
+
* list is renumbered. Answers the indices in conflict, as
|
|
1388
|
+
* `constraintConflictsOf` names them — empty when every one holds — or null
|
|
1389
|
+
* when the dep cannot store.
|
|
686
1390
|
*/
|
|
687
|
-
declare function setConstraints(dep: EditAnchorsDep, constraints: readonly PathConstraint[], label: string):
|
|
1391
|
+
declare function setConstraints(dep: EditAnchorsDep, constraints: readonly PathConstraint[], label: string): number[] | null;
|
|
688
1392
|
/** The constraint selected in path edit, as an index into the open path's list, or null. */
|
|
689
1393
|
declare function selectedConstraintOf(dep: EditAnchorsDep): number | null;
|
|
690
1394
|
/** The constraints extension, its marks drawn in `style`'s colors. */
|
|
691
1395
|
declare function createConstraintsExtension(style?: Partial<ConstraintGlyphStyle>): PathEditExtension;
|
|
692
1396
|
|
|
1397
|
+
/**
|
|
1398
|
+
* Constraints between nodes. A link is a node of its own: its `dependsOn`
|
|
1399
|
+
* names the nodes it ties, in order, and its `data.constraintLink` holds one
|
|
1400
|
+
* `PathConstraint` whose anchors are numbered over theirs one after another —
|
|
1401
|
+
* with two nodes of 4 and 5 anchors, anchor 6 is the second node's anchor 2.
|
|
1402
|
+
* Being a node, it is saved and undone with the scene, and deleting a node it
|
|
1403
|
+
* ties deletes it too. It draws nothing and takes no clicks; keep it on a
|
|
1404
|
+
* layer that is not exported, such as an annotation layer.
|
|
1405
|
+
*
|
|
1406
|
+
* An edit of any node a link ties solves every node the links reach in one
|
|
1407
|
+
* solve: an anchor held on another node's segment slides along it when
|
|
1408
|
+
* dragged and follows it when that node is edited.
|
|
1409
|
+
*/
|
|
1410
|
+
|
|
1411
|
+
/** What a link node keeps in `data`. */
|
|
1412
|
+
interface ConstraintLinkData {
|
|
1413
|
+
constraintLink: PathConstraint;
|
|
1414
|
+
}
|
|
1415
|
+
/** The constraint `data` holds as a link, or null when it is not one. */
|
|
1416
|
+
declare function constraintLinkOf(data: unknown): PathConstraint | null;
|
|
1417
|
+
/** Options for {@link constraintLinkNode}. */
|
|
1418
|
+
interface ConstraintLinkNodeOptions<TPose> {
|
|
1419
|
+
layer: string;
|
|
1420
|
+
/** The nodes it ties, in the order its anchors number them. */
|
|
1421
|
+
nodes: readonly string[];
|
|
1422
|
+
constraint: PathConstraint;
|
|
1423
|
+
id?: string;
|
|
1424
|
+
/** Default: an empty box at the origin. */
|
|
1425
|
+
pose?: TPose;
|
|
1426
|
+
}
|
|
1427
|
+
/** A link node, ready for `scene.add`. Registers the painter that keeps link nodes from drawing. */
|
|
1428
|
+
declare function constraintLinkNode<TPose = RectPose>(opts: ConstraintLinkNodeOptions<TPose>): AddNodeSpec<ConstraintLinkData, string, TPose>;
|
|
1429
|
+
|
|
1430
|
+
/**
|
|
1431
|
+
* The controls for the selected corners of a path in edit: a schema any
|
|
1432
|
+
* prefs form draws, the values and mixed fields it shows for a selection,
|
|
1433
|
+
* and the `setCorners` params a change to one of them makes.
|
|
1434
|
+
*/
|
|
1435
|
+
|
|
1436
|
+
/** How far the parameter slider reaches either side of the bevel; the
|
|
1437
|
+
* `square` and `notch` keywords stand for the two infinities beyond it. */
|
|
1438
|
+
declare const CORNER_K_SLIDER_RANGE = 4;
|
|
1439
|
+
/** What the corner controls ask for while no corner is selected. */
|
|
1440
|
+
declare const CORNER_CONTROLS_PROMPT = "Click a corner anchor (Shift-click for more) to edit it";
|
|
1441
|
+
/** The corner controls as a prefs schema: the keywords, the parameter, and
|
|
1442
|
+
* the radius, each disabled while no corner is selected. */
|
|
1443
|
+
declare const CORNER_CONTROLS: PrefGroup;
|
|
1444
|
+
/** What the controls show for a selection. */
|
|
1445
|
+
interface CornerControlsState {
|
|
1446
|
+
/** `shape` is null where no keyword applies, so a form does not fall back
|
|
1447
|
+
* to the leaf's default. */
|
|
1448
|
+
values: {
|
|
1449
|
+
count: number;
|
|
1450
|
+
shape: CornerKeyword | null;
|
|
1451
|
+
k?: number;
|
|
1452
|
+
radius?: number;
|
|
1453
|
+
};
|
|
1454
|
+
/** The fields whose selected corners disagree. */
|
|
1455
|
+
mixed: ReadonlySet<string>;
|
|
1456
|
+
}
|
|
1457
|
+
/** The controls for the corners of `path` among `selected` anchors. A sharp
|
|
1458
|
+
* corner shows no shape and no parameter. */
|
|
1459
|
+
declare function cornerControlsState(path: PolygonPath | null, selected: ReadonlySet<number>): CornerControlsState;
|
|
1460
|
+
/** The `setCorners` params a change of `field` to `value` makes, or null for
|
|
1461
|
+
* a field that sets nothing. */
|
|
1462
|
+
declare function cornerControlsParams(field: string, value: unknown): {
|
|
1463
|
+
shape: CornerShape;
|
|
1464
|
+
} | {
|
|
1465
|
+
radius: number;
|
|
1466
|
+
} | null;
|
|
1467
|
+
|
|
1468
|
+
/** The part of a scene the controls read. */
|
|
1469
|
+
interface CornerControlsScene {
|
|
1470
|
+
get(id: NodeId): EditableShape | undefined;
|
|
1471
|
+
subscribe(listener: () => void): () => void;
|
|
1472
|
+
}
|
|
1473
|
+
/** Which path is open for anchor editing and which of its anchors are
|
|
1474
|
+
* selected: what a `PathEditHost` that owns the anchor selection knows. */
|
|
1475
|
+
interface CornerControlsSelection {
|
|
1476
|
+
editingId(): string | null;
|
|
1477
|
+
selectedAnchors(): ReadonlySet<number>;
|
|
1478
|
+
subscribe(listener: () => void): () => void;
|
|
1479
|
+
}
|
|
1480
|
+
/** What {@link useCornerControls} gives a corner panel to draw. */
|
|
1481
|
+
interface UseCornerControlsReturn {
|
|
1482
|
+
/** The schema a prefs form draws: `CORNER_CONTROLS`. Its `name` is the
|
|
1483
|
+
* controls' title. */
|
|
1484
|
+
schema: typeof CORNER_CONTROLS;
|
|
1485
|
+
/** What to show above the form, or null once a corner is selected. */
|
|
1486
|
+
prompt: string | null;
|
|
1487
|
+
values: Record<string, unknown>;
|
|
1488
|
+
mixed: ReadonlySet<string>;
|
|
1489
|
+
/** A prefs form's `onChange` for `CORNER_CONTROLS`. */
|
|
1490
|
+
onChange: (field: string, value: unknown) => void;
|
|
1491
|
+
}
|
|
1492
|
+
/**
|
|
1493
|
+
* A corner panel over the selected corners of the path open for anchor
|
|
1494
|
+
* editing: their shared shape and radius, kept current as the scene or the
|
|
1495
|
+
* selection changes, and an `onChange` that writes through `setCorners`.
|
|
1496
|
+
*/
|
|
1497
|
+
declare function useCornerControls(scene: CornerControlsScene, selection: CornerControlsSelection): UseCornerControlsReturn;
|
|
1498
|
+
|
|
693
1499
|
/**
|
|
694
1500
|
* A node's path constraints: kept as `data.constraints`, numbered by the
|
|
695
1501
|
* anchors of its editable polygon, and solved in the frame that polygon is
|
|
@@ -701,13 +1507,44 @@ declare function constraintsOf(data: unknown): readonly PathConstraint[];
|
|
|
701
1507
|
/** Radians the frame `horizontal` and `vertical` read is turned from the world's: a `data.path` node's rotation. */
|
|
702
1508
|
declare function constraintAxisOf(node: EditableShape | null | undefined): number;
|
|
703
1509
|
/**
|
|
704
|
-
* Indices of `node`'s constraints that do not hold in its committed path
|
|
705
|
-
* the
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
*
|
|
709
|
-
*
|
|
1510
|
+
* Indices of `node`'s constraints that do not hold in its committed path, and
|
|
1511
|
+
* the others each conflict needs: every member of a smallest set that cannot
|
|
1512
|
+
* all hold. Edits leave the ones that do not hold out of the solve, and so
|
|
1513
|
+
* does a whole-shape transform — resize, rotate, flip — which carries the
|
|
1514
|
+
* list unchanged: a constraint the transform breaks, such as a set length
|
|
1515
|
+
* under a scale or an equal length under a non-uniform one, is reported here
|
|
1516
|
+
* rather than solved back.
|
|
710
1517
|
*/
|
|
711
1518
|
declare function constraintConflictsOf(node: EditableShape | null | undefined): number[];
|
|
712
1519
|
|
|
713
|
-
|
|
1520
|
+
/** A glyph this package draws, by its bare name. */
|
|
1521
|
+
type PathToolsIconName = 'smudgeBrush' | 'distort' | 'envelope' | 'puppetWarp' | 'blend' | 'bendAlong' | 'repeatAlong' | 'expand' | 'balanceHandles' | 'equalizeHandles' | 'lengthen' | 'trim' | 'extend' | 'girth' | 'spiro' | 'reversePath' | 'setPathStart' | 'cornerRadius' | 'cornerShape' | 'convertSegment' | 'straightenSegment' | 'curveSegment' | 'extremeAnchors';
|
|
1522
|
+
declare module '@weasel-js/icons' {
|
|
1523
|
+
interface IconName {
|
|
1524
|
+
'path-tools:smudgeBrush': true;
|
|
1525
|
+
'path-tools:distort': true;
|
|
1526
|
+
'path-tools:envelope': true;
|
|
1527
|
+
'path-tools:puppetWarp': true;
|
|
1528
|
+
'path-tools:blend': true;
|
|
1529
|
+
'path-tools:bendAlong': true;
|
|
1530
|
+
'path-tools:repeatAlong': true;
|
|
1531
|
+
'path-tools:expand': true;
|
|
1532
|
+
'path-tools:balanceHandles': true;
|
|
1533
|
+
'path-tools:equalizeHandles': true;
|
|
1534
|
+
'path-tools:lengthen': true;
|
|
1535
|
+
'path-tools:trim': true;
|
|
1536
|
+
'path-tools:extend': true;
|
|
1537
|
+
'path-tools:girth': true;
|
|
1538
|
+
'path-tools:spiro': true;
|
|
1539
|
+
'path-tools:reversePath': true;
|
|
1540
|
+
'path-tools:setPathStart': true;
|
|
1541
|
+
'path-tools:cornerRadius': true;
|
|
1542
|
+
'path-tools:cornerShape': true;
|
|
1543
|
+
'path-tools:convertSegment': true;
|
|
1544
|
+
'path-tools:straightenSegment': true;
|
|
1545
|
+
'path-tools:curveSegment': true;
|
|
1546
|
+
'path-tools:extremeAnchors': true;
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
export { ANCHOR_SELECTION_GROUP, CONSTRAINTS_EXTENSION_ID, CORNER_CONTROLS, CORNER_CONTROLS_PROMPT, CORNER_K_SLIDER_RANGE, CORNER_WIDGET_STANDOFF_PX, type ConstrainAnchorsParams, type ConstraintGlyphStyle, type ConstraintLinkData, type ConstraintLinkNodeOptions, type CornerControlsScene, type CornerControlsSelection, type CornerControlsState, type CornerWidgetStyle, type CreateSpiroPreviewLayerOptions, DEFAULT_BRIDGE_TENSION, DEFAULT_CORNER_SHAPE, DEFAULT_CORNER_TRIM_SHARE, DEFAULT_ENVELOPE_SIZE, DEFAULT_SMUDGE_RADIUS_PX, DEFAULT_SMUDGE_STRENGTH, DEFAULT_WARP_TOLERANCE, GIRTH_CLEAR_ID, GIRTH_DRAG_ID, GIRTH_HOVER_ID, GIRTH_UNHOVER_ID, type GirthEnv, type GirthFocus, type HandleSnapOptions, type HandleSnapOptionsInput, type HeldPathWarp, LENGTHEN_TOOL, type LengthenPathParams, PATH_BALANCE_CHROME_ID, PATH_COMB_CHROME_ID, PATH_CORNERS_CHROME_ID, PATH_DIRECTION_CHROME_ID, PATH_EFFECTS_GROUP, type PathDirectionStyle, type PathEditBalanceStyle, type PathEditCombOptions, type PathToolsIconName, type ResamplePathParams, type ResolvedPathWarp, SIMPLIFY_BRUSH_RADIUS_PX, SIMPLIFY_BRUSH_TOOL, SPIRO_FORM, type ShapeBuilderFace, type ShapeBuilderMode, type ShapeBuilderPlan, type SimplifyBrushParams, type SmudgeBrushParams, type SoftSelectionOptions, type SpiroPreviewState, type SpiroShape, type StrokeClickToolOptions, type UseCornerControlsReturn, type UseDistortToolOptions, type UseEnvelopeToolOptions, type UseExtendToolOptions, type UseGirthToolOptions, type UsePuppetToolOptions, type UseShapeBuilderToolOptions, type UseSmudgeBrushToolOptions, type UseSpiroToolOptions, type UseTrimToolOptions, type WarpHandleScratch, type WarpKind, type WarpSettings, type WarpTool, type WarpToolOptions, type WidthEdgeHit, type WidthGrip, type WidthTarget, addExtremeAnchorsAction, addExtremesPreset, anchorSelectionPreset, asSpiro, balanceCommands, balanceHandlesAction, balancePreset, bendAlongAction, blendAction, bridgeAnchorsAction, bridgePathsAction, bridgePreset, bridgeTensionOf, brushRingCursor, combCommands, configureWarpAction, constrainAnchorsAction, constraintAxisOf, constraintConflictsOf, constraintLinkNode, constraintLinkOf, constraintsForAnchors, constraintsOf, constraintsPreset, convertSegmentAtAction, convertSegmentsAction, cornerControlsParams, cornerControlsState, cornerShapePreset, cornerWidgetCommands, cornerWidgetFrames, createBalanceExtension, createBalancePreset, createCombExtension, createConstraintsExtension, createConstraintsPreset, createCornerShapePreset, createCornerWidgetsExtension, createCurvatureCombPreset, createDirectionExtension, createGirthActions, createGirthOverlay, createHandleSnapExtension, createHandleSnapPreset, createPathStructurePreset, createSoftSelectionExtension, createSoftSelectionPreset, createSpiroPreviewLayer, curvatureCombPreset, cycleCornerShapeAction, deleteConstraintAction, directionCommands, editCornerAction, editPathEffectAction, equalizeHandlesAction, expandPathEffectAction, expandWarpAction, extendPreset, extendToMeetAction, facesAlong, growAnchorSelectionAction, handleLockAngleAction, handleLockLengthAction, handleLocksPreset, handleSnapPreset, handleSnapSource, harmonizeAnchorsAction, harmonizePreset, heldPathWarpOf, invertAnchorSelectionAction, lengthenPathAction, lengthenPreset, lengthenToolAction, pathEffectsPreset, pathStructurePreset, pathTools, planShapeBuilder, planTrim, releaseSpiroAction, repeatAlongAction, resamplePathAction, resamplePreset, resolvePathWarp, respiro, respiroWithKind, reversePathAction, segmentTypePreset, selectCornerAnchorsAction, selectEveryNthAnchorAction, selectSmoothAnchorsAction, selectedConstraintOf, setConstraints, setCornersAction, setPathStartAction, setSpiroKindAction, shrinkAnchorSelectionAction, simplifyBrushAction, simplifyBrushPreset, simplifyBrushToolAction, smudgeBrushAction, smudgePreset, spiroContours, spiroEditPath, spiroExtension, spiroMarker, spiroNodeData, spiroOf, spiroPreset, spiroRepresentation, trimPathAction, trimPreset, unconstrainAnchorsAction, useCornerControls, useDistortTool, useEnvelopeTool, useExtendTool, useGirthTool, usePuppetTool, useShapeBuilderTool, useSmudgeBrushTool, useSpiroTool, useTrimTool, warpHandleScratchOf, warpLayerId, warpPreset, withPathWarp, withoutPathWarp, withoutSpiro };
|