@remotion/paths 4.0.164 → 4.0.166
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/dist/debug-path.d.ts +6 -0
- package/dist/debug-path.js +57 -0
- package/dist/get-end-position.d.ts +2 -0
- package/dist/get-end-position.js +70 -0
- package/dist/helpers/types.d.ts +13 -12
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3 -1
- package/dist/interpolate-path/convert-to-same-instruction-type.d.ts +22 -0
- package/dist/interpolate-path/convert-to-same-instruction-type.js +109 -0
- package/dist/interpolate-path/de-casteljau.d.ts +14 -0
- package/dist/interpolate-path/de-casteljau.js +44 -0
- package/dist/interpolate-path/extend-command.d.ts +2 -2
- package/dist/interpolate-path/extend-command.js +8 -7
- package/dist/interpolate-path/interpolate-commands.d.ts +16 -0
- package/dist/interpolate-path/interpolate-commands.js +108 -0
- package/dist/interpolate-path/interpolate-instruction-of-same-kind.d.ts +2 -0
- package/dist/interpolate-path/interpolate-instruction-of-same-kind.js +73 -0
- package/dist/interpolate-path/interpolate-instructions.d.ts +16 -0
- package/dist/interpolate-path/interpolate-instructions.js +92 -0
- package/dist/interpolate-path/interpolate-path.js +8 -116
- package/dist/interpolate-path/points-to-command.d.ts +9 -0
- package/dist/interpolate-path/points-to-command.js +46 -0
- package/dist/interpolate-path/split-curve-as-points.d.ts +8 -0
- package/dist/interpolate-path/split-curve-as-points.js +40 -0
- package/dist/interpolate-path/split-curve.d.ts +3 -3
- package/dist/interpolate-path/split-curve.js +18 -122
- package/dist/interpolate-path/split-segment.d.ts +2 -2
- package/dist/interpolate-path/split-segment.js +12 -12
- package/dist/warp-path/warp-helpers.d.ts +0 -3
- package/dist/warp-path/warp-helpers.js +1 -4
- package/package.json +1 -1
|
@@ -6,9 +6,6 @@ export type WarpPathFn = (point: {
|
|
|
6
6
|
x: number;
|
|
7
7
|
y: number;
|
|
8
8
|
};
|
|
9
|
-
export declare function split(p: number[][], t?: number): number[][][];
|
|
10
|
-
export declare function interpolateUntil(points: [number, number][], threshold: number, deltaFunction?: (points: [number, number][]) => number): [number, number][][];
|
|
11
|
-
export declare function createLineSegment(points: number[][]): ReducedInstruction;
|
|
12
9
|
export declare function svgPathInterpolate(path: ReducedInstruction[], threshold: number): ReducedInstruction[];
|
|
13
10
|
export declare const warpTransform: (path: ReducedInstruction[], transformer: WarpPathFn) => ReducedInstruction[];
|
|
14
11
|
export declare const fixZInstruction: (instructions: ReducedInstruction[]) => ReducedInstruction[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fixZInstruction = exports.warpTransform = exports.svgPathInterpolate =
|
|
3
|
+
exports.fixZInstruction = exports.warpTransform = exports.svgPathInterpolate = void 0;
|
|
4
4
|
const euclideanDistance = (points) => {
|
|
5
5
|
const startPoint = points[0];
|
|
6
6
|
const endPoint = points[points.length - 1];
|
|
@@ -38,7 +38,6 @@ function split(p, t = 0.5) {
|
|
|
38
38
|
}
|
|
39
39
|
return [seg0, seg1];
|
|
40
40
|
}
|
|
41
|
-
exports.split = split;
|
|
42
41
|
function interpolateUntil(points, threshold, deltaFunction = euclideanDistance) {
|
|
43
42
|
const stack = [points];
|
|
44
43
|
const segments = [];
|
|
@@ -57,7 +56,6 @@ function interpolateUntil(points, threshold, deltaFunction = euclideanDistance)
|
|
|
57
56
|
}
|
|
58
57
|
return segments;
|
|
59
58
|
}
|
|
60
|
-
exports.interpolateUntil = interpolateUntil;
|
|
61
59
|
function createLineSegment(points) {
|
|
62
60
|
switch (points.length) {
|
|
63
61
|
case 2:
|
|
@@ -88,7 +86,6 @@ function createLineSegment(points) {
|
|
|
88
86
|
throw new Error('Expected 2, 3 or 4 points for a line segment, got ' + points.length);
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
|
-
exports.createLineSegment = createLineSegment;
|
|
92
89
|
function warpInterpolate(path, threshold, deltaFunction) {
|
|
93
90
|
let prexX = 0;
|
|
94
91
|
let prexY = 0;
|