@remotion/svg-3d-engine 4.0.357 → 4.0.360
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/.turbo/turbo-lint.log +15 -0
- package/.turbo/turbo-make.log +1 -4
- package/package.json +33 -33
- package/LICENSE.md +0 -49
- package/dist/cjs/3d-svg.d.ts +0 -22
- package/dist/cjs/3d-svg.js +0 -26
- package/dist/cjs/elements.d.ts +0 -8
- package/dist/cjs/elements.js +0 -10
- package/dist/cjs/extrude-element.d.ts +0 -15
- package/dist/cjs/extrude-element.js +0 -105
- package/dist/cjs/fix-z.d.ts +0 -3
- package/dist/cjs/fix-z.js +0 -44
- package/dist/cjs/index.d.ts +0 -6
- package/dist/cjs/index.js +0 -24
- package/dist/cjs/make-id.d.ts +0 -1
- package/dist/cjs/make-id.js +0 -7
- package/dist/cjs/map-face.d.ts +0 -25
- package/dist/cjs/map-face.js +0 -124
- package/dist/cjs/matrix.d.ts +0 -66
- package/dist/cjs/matrix.js +0 -308
- package/dist/cjs/subdivide-instructions.d.ts +0 -4
- package/dist/cjs/subdivide-instructions.js +0 -180
- package/dist/cjs/truthy.d.ts +0 -3
- package/dist/cjs/truthy.js +0 -6
- package/dist/esm/index.mjs +0 -1378
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
[0m[2m[35m$[0m [2m[1meslint src[0m
|
|
3
|
+
=============
|
|
4
|
+
|
|
5
|
+
WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.
|
|
6
|
+
|
|
7
|
+
You may find that it works just fine, or you may not.
|
|
8
|
+
|
|
9
|
+
SUPPORTED TYPESCRIPT VERSIONS: >=4.7.4 <5.7.0
|
|
10
|
+
|
|
11
|
+
YOUR TYPESCRIPT VERSION: 5.8.2
|
|
12
|
+
|
|
13
|
+
Please only submit bug reports when using the officially supported version.
|
|
14
|
+
|
|
15
|
+
=============
|
package/.turbo/turbo-make.log
CHANGED
package/package.json
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
2
|
+
"name": "@remotion/svg-3d-engine",
|
|
3
|
+
"dependencies": {
|
|
4
|
+
"@remotion/paths": "4.0.359"
|
|
5
|
+
},
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@remotion/eslint-config-internal": "4.0.359",
|
|
8
|
+
"eslint": "9.19.0"
|
|
9
|
+
},
|
|
10
|
+
"main": "dist/cjs/index.js",
|
|
11
|
+
"types": "dist/cjs/index.d.ts",
|
|
12
|
+
"module": "dist/esm/index.mjs",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"lint": "eslint src",
|
|
15
|
+
"make": "tsc -d && bun --env-file=../.env.bundle bundle.ts"
|
|
16
|
+
},
|
|
17
|
+
"exports": {
|
|
18
|
+
"./package.json": "./package.json",
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/cjs/index.d.ts",
|
|
21
|
+
"module": "./dist/esm/index.mjs",
|
|
22
|
+
"import": "./dist/esm/index.mjs",
|
|
23
|
+
"require": "./dist/cjs/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"version": "4.0.360",
|
|
27
|
+
"repository": {
|
|
28
|
+
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/svg-3d-engine"
|
|
29
|
+
},
|
|
30
|
+
"description": "3D SVG extrusion effects",
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/LICENSE.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Remotion License
|
|
2
|
-
|
|
3
|
-
In Remotion 5.0, the license will slightly change. [View the changes here](https://github.com/remotion-dev/remotion/pull/3750).
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
|
|
8
|
-
|
|
9
|
-
- [Free License](#free-license)
|
|
10
|
-
- [Company License](#company-license)
|
|
11
|
-
|
|
12
|
-
## Free License
|
|
13
|
-
|
|
14
|
-
Copyright © 2025 [Remotion](https://www.remotion.dev)
|
|
15
|
-
|
|
16
|
-
### Eligibility
|
|
17
|
-
|
|
18
|
-
You are eligible to use Remotion for free if you are:
|
|
19
|
-
|
|
20
|
-
- an individual
|
|
21
|
-
- a for-profit organization with up to 3 employees
|
|
22
|
-
- a non-profit or not-for-profit organization
|
|
23
|
-
- evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
|
|
24
|
-
|
|
25
|
-
### Allowed use cases
|
|
26
|
-
|
|
27
|
-
Permission is hereby granted, free of charge, to any person eligible for the "Free License", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
|
|
28
|
-
|
|
29
|
-
### Disallowed use cases
|
|
30
|
-
|
|
31
|
-
It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
|
|
32
|
-
|
|
33
|
-
### Warranty notice
|
|
34
|
-
|
|
35
|
-
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
|
|
36
|
-
|
|
37
|
-
### Support
|
|
38
|
-
|
|
39
|
-
Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
|
|
40
|
-
|
|
41
|
-
## Company License
|
|
42
|
-
|
|
43
|
-
You are required to obtain a Company License to use Remotion if you are not within the group of entities eligible for a Free License. This license will enable you to use Remotion for the allowed use cases specified in the Free License, and give you access to prioritized support (read the [Support Policy](https://www.remotion.dev/docs/support)).
|
|
44
|
-
|
|
45
|
-
Visit [remotion.pro](https://www.remotion.pro/license) for pricing and to buy a license.
|
|
46
|
-
|
|
47
|
-
### FAQs
|
|
48
|
-
|
|
49
|
-
Are you not sure whether you need a Company License because of an edge case? Here are some [frequently asked questions](https://www.remotion.pro/faq).
|
package/dist/cjs/3d-svg.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Vector4D } from './matrix';
|
|
2
|
-
export type ThreeDReducedInstruction = {
|
|
3
|
-
type: 'M';
|
|
4
|
-
point: Vector4D;
|
|
5
|
-
} | {
|
|
6
|
-
type: 'L';
|
|
7
|
-
point: Vector4D;
|
|
8
|
-
} | {
|
|
9
|
-
type: 'C';
|
|
10
|
-
cp1: Vector4D;
|
|
11
|
-
cp2: Vector4D;
|
|
12
|
-
point: Vector4D;
|
|
13
|
-
} | {
|
|
14
|
-
type: 'Q';
|
|
15
|
-
cp: Vector4D;
|
|
16
|
-
point: Vector4D;
|
|
17
|
-
} | {
|
|
18
|
-
type: 'Z';
|
|
19
|
-
point: Vector4D;
|
|
20
|
-
};
|
|
21
|
-
export declare const serializeThreeDReducedInstruction: (instruction: ThreeDReducedInstruction) => string;
|
|
22
|
-
export declare const threeDIntoSvgPath: (instructions: ThreeDReducedInstruction[]) => string;
|
package/dist/cjs/3d-svg.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.threeDIntoSvgPath = exports.serializeThreeDReducedInstruction = void 0;
|
|
4
|
-
const serializeThreeDReducedInstruction = (instruction) => {
|
|
5
|
-
if (instruction.type === 'M') {
|
|
6
|
-
return `M ${instruction.point[0]} ${instruction.point[1]}`;
|
|
7
|
-
}
|
|
8
|
-
if (instruction.type === 'L') {
|
|
9
|
-
return `L ${instruction.point[0]} ${instruction.point[1]}`;
|
|
10
|
-
}
|
|
11
|
-
if (instruction.type === 'C') {
|
|
12
|
-
return `C ${instruction.cp1[0]} ${instruction.cp1[1]} ${instruction.cp2[0]} ${instruction.cp2[1]} ${instruction.point[0]} ${instruction.point[1]}`;
|
|
13
|
-
}
|
|
14
|
-
if (instruction.type === 'Q') {
|
|
15
|
-
return `Q ${instruction.cp[0]} ${instruction.cp[1]} ${instruction.point[0]} ${instruction.point[1]}`;
|
|
16
|
-
}
|
|
17
|
-
if (instruction.type === 'Z') {
|
|
18
|
-
return 'Z';
|
|
19
|
-
}
|
|
20
|
-
throw new Error('Unknown instruction type');
|
|
21
|
-
};
|
|
22
|
-
exports.serializeThreeDReducedInstruction = serializeThreeDReducedInstruction;
|
|
23
|
-
const threeDIntoSvgPath = (instructions) => instructions
|
|
24
|
-
.map((instruction) => (0, exports.serializeThreeDReducedInstruction)(instruction))
|
|
25
|
-
.join(' ');
|
|
26
|
-
exports.threeDIntoSvgPath = threeDIntoSvgPath;
|
package/dist/cjs/elements.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { FaceType } from './map-face';
|
|
2
|
-
import type { MatrixTransform4D } from './matrix';
|
|
3
|
-
export type ThreeDElement = {
|
|
4
|
-
faces: FaceType[];
|
|
5
|
-
id: string;
|
|
6
|
-
description: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const transformFaces: (faces: FaceType[], transformations: MatrixTransform4D[]) => FaceType[];
|
package/dist/cjs/elements.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformFaces = void 0;
|
|
4
|
-
const map_face_1 = require("./map-face");
|
|
5
|
-
const transformFaces = (faces, transformations) => {
|
|
6
|
-
return faces.map((face) => {
|
|
7
|
-
return (0, map_face_1.transformFace)(face, transformations);
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
exports.transformFaces = transformFaces;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Instruction } from '@remotion/paths';
|
|
2
|
-
import type { FaceType } from './map-face';
|
|
3
|
-
import type { MatrixTransform4D } from './matrix';
|
|
4
|
-
type ExtrudeElementOptions = {
|
|
5
|
-
depth: number;
|
|
6
|
-
sideColor: string;
|
|
7
|
-
points: Instruction[];
|
|
8
|
-
description?: string;
|
|
9
|
-
crispEdges: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare const extrudeElement: ({ depth, sideColor, points, crispEdges, }: ExtrudeElementOptions) => FaceType[];
|
|
12
|
-
export declare const extrudeAndTransformElement: (options: ExtrudeElementOptions & {
|
|
13
|
-
transformations: MatrixTransform4D;
|
|
14
|
-
}) => FaceType[];
|
|
15
|
-
export {};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extrudeAndTransformElement = exports.extrudeElement = void 0;
|
|
4
|
-
const fix_z_1 = require("./fix-z");
|
|
5
|
-
const map_face_1 = require("./map-face");
|
|
6
|
-
const matrix_1 = require("./matrix");
|
|
7
|
-
const subdivide_instructions_1 = require("./subdivide-instructions");
|
|
8
|
-
const truthy_1 = require("./truthy");
|
|
9
|
-
const inverseInstruction = (instruction, comingFrom) => {
|
|
10
|
-
if (instruction.type === 'M') {
|
|
11
|
-
return {
|
|
12
|
-
type: 'M',
|
|
13
|
-
point: comingFrom,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
if (instruction.type === 'L') {
|
|
17
|
-
return {
|
|
18
|
-
type: 'L',
|
|
19
|
-
point: comingFrom,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
if (instruction.type === 'C') {
|
|
23
|
-
return {
|
|
24
|
-
type: 'C',
|
|
25
|
-
point: comingFrom,
|
|
26
|
-
cp1: instruction.cp2,
|
|
27
|
-
cp2: instruction.cp1,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
if (instruction.type === 'Q') {
|
|
31
|
-
return {
|
|
32
|
-
type: 'Q',
|
|
33
|
-
point: comingFrom,
|
|
34
|
-
cp: instruction.cp,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
if (instruction.type === 'Z') {
|
|
38
|
-
return {
|
|
39
|
-
type: 'L',
|
|
40
|
-
point: comingFrom,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
throw new Error('Unknown instruction type');
|
|
44
|
-
};
|
|
45
|
-
const extrudeElement = ({ depth, sideColor, points, crispEdges, }) => {
|
|
46
|
-
const threeD = (0, fix_z_1.turnInto3D)(points);
|
|
47
|
-
const instructions = {
|
|
48
|
-
centerPoint: [0, 0, 0, 1],
|
|
49
|
-
points: (0, subdivide_instructions_1.subdivideInstructions)((0, subdivide_instructions_1.subdivideInstructions)((0, subdivide_instructions_1.subdivideInstructions)(threeD))),
|
|
50
|
-
color: 'black',
|
|
51
|
-
crispEdges,
|
|
52
|
-
};
|
|
53
|
-
const unscaledBackFace = (0, map_face_1.transformFace)(instructions, [(0, matrix_1.translateZ)(depth / 2)]);
|
|
54
|
-
const inbetween = unscaledBackFace.points.map((t, i) => {
|
|
55
|
-
const nextInstruction = i === unscaledBackFace.points.length - 1
|
|
56
|
-
? unscaledBackFace.points[0]
|
|
57
|
-
: unscaledBackFace.points[i + 1];
|
|
58
|
-
const currentPoint = t.point;
|
|
59
|
-
const nextPoint = nextInstruction.point;
|
|
60
|
-
const movingOver = [
|
|
61
|
-
nextPoint[0],
|
|
62
|
-
nextPoint[1],
|
|
63
|
-
nextPoint[2] - depth,
|
|
64
|
-
nextPoint[3],
|
|
65
|
-
];
|
|
66
|
-
const translatedInstruction = (0, map_face_1.translateSvgInstruction)(inverseInstruction(nextInstruction, currentPoint), 0, 0, -depth);
|
|
67
|
-
const newInstructions = [
|
|
68
|
-
{
|
|
69
|
-
type: 'M',
|
|
70
|
-
point: currentPoint,
|
|
71
|
-
},
|
|
72
|
-
nextInstruction,
|
|
73
|
-
nextInstruction.type === 'Z'
|
|
74
|
-
? {
|
|
75
|
-
type: 'M',
|
|
76
|
-
point: nextInstruction.point,
|
|
77
|
-
}
|
|
78
|
-
: null,
|
|
79
|
-
{
|
|
80
|
-
type: 'L',
|
|
81
|
-
point: movingOver,
|
|
82
|
-
},
|
|
83
|
-
translatedInstruction,
|
|
84
|
-
{
|
|
85
|
-
type: 'L',
|
|
86
|
-
point: currentPoint,
|
|
87
|
-
},
|
|
88
|
-
].filter(truthy_1.truthy);
|
|
89
|
-
return {
|
|
90
|
-
points: newInstructions,
|
|
91
|
-
color: sideColor,
|
|
92
|
-
centerPoint: [0, 0, 0, 1],
|
|
93
|
-
crispEdges: true,
|
|
94
|
-
};
|
|
95
|
-
});
|
|
96
|
-
return inbetween;
|
|
97
|
-
};
|
|
98
|
-
exports.extrudeElement = extrudeElement;
|
|
99
|
-
const extrudeAndTransformElement = (options) => {
|
|
100
|
-
const inbetween = (0, exports.extrudeElement)(options);
|
|
101
|
-
return inbetween.map((face) => ({
|
|
102
|
-
...(0, map_face_1.transformFace)(face, [options.transformations]),
|
|
103
|
-
}));
|
|
104
|
-
};
|
|
105
|
-
exports.extrudeAndTransformElement = extrudeAndTransformElement;
|
package/dist/cjs/fix-z.d.ts
DELETED
package/dist/cjs/fix-z.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.turnInto3D = void 0;
|
|
4
|
-
const paths_1 = require("@remotion/paths");
|
|
5
|
-
const turnInto3D = (instructions) => {
|
|
6
|
-
let lastMove = [0, 0, 0, 1];
|
|
7
|
-
const newInstructions = [];
|
|
8
|
-
const reduced = (0, paths_1.reduceInstructions)(instructions);
|
|
9
|
-
for (let i = 0; i < reduced.length; i++) {
|
|
10
|
-
const instruction = reduced[i];
|
|
11
|
-
if (instruction.type === 'Z') {
|
|
12
|
-
newInstructions.push({
|
|
13
|
-
type: 'Z',
|
|
14
|
-
point: lastMove,
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
else if (instruction.type === 'M') {
|
|
18
|
-
lastMove = [instruction.x, instruction.y, 0, 1];
|
|
19
|
-
newInstructions.push({
|
|
20
|
-
point: [instruction.x, instruction.y, 0, 1],
|
|
21
|
-
type: 'M',
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
else if (instruction.type === 'L') {
|
|
25
|
-
newInstructions.push({
|
|
26
|
-
type: 'L',
|
|
27
|
-
point: [instruction.x, instruction.y, 0, 1],
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
else if (instruction.type === 'C') {
|
|
31
|
-
newInstructions.push({
|
|
32
|
-
type: 'C',
|
|
33
|
-
point: [instruction.x, instruction.y, 0, 1],
|
|
34
|
-
cp1: [instruction.cp1x, instruction.cp1y, 0, 1],
|
|
35
|
-
cp2: [instruction.cp2x, instruction.cp2y, 0, 1],
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
throw new Error('unknown');
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return newInstructions;
|
|
43
|
-
};
|
|
44
|
-
exports.turnInto3D = turnInto3D;
|
package/dist/cjs/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { MatrixTransform4D, Vector4D } from './matrix';
|
|
2
|
-
export type { ThreeDReducedInstruction } from './3d-svg';
|
|
3
|
-
export { threeDIntoSvgPath } from './3d-svg';
|
|
4
|
-
export { extrudeAndTransformElement, extrudeElement } from './extrude-element';
|
|
5
|
-
export { transformPath, type FaceType } from './map-face';
|
|
6
|
-
export { aroundCenterPoint, interpolateMatrix4d, makeMatrix3dTransform, reduceMatrices, rotateX, rotateY, rotateZ, scaleX, scaleY, scaled, translateX, translateY, translateZ, } from './matrix';
|
package/dist/cjs/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.translateZ = exports.translateY = exports.translateX = exports.scaled = exports.scaleY = exports.scaleX = exports.rotateZ = exports.rotateY = exports.rotateX = exports.reduceMatrices = exports.makeMatrix3dTransform = exports.interpolateMatrix4d = exports.aroundCenterPoint = exports.transformPath = exports.extrudeElement = exports.extrudeAndTransformElement = exports.threeDIntoSvgPath = void 0;
|
|
4
|
-
var _3d_svg_1 = require("./3d-svg");
|
|
5
|
-
Object.defineProperty(exports, "threeDIntoSvgPath", { enumerable: true, get: function () { return _3d_svg_1.threeDIntoSvgPath; } });
|
|
6
|
-
var extrude_element_1 = require("./extrude-element");
|
|
7
|
-
Object.defineProperty(exports, "extrudeAndTransformElement", { enumerable: true, get: function () { return extrude_element_1.extrudeAndTransformElement; } });
|
|
8
|
-
Object.defineProperty(exports, "extrudeElement", { enumerable: true, get: function () { return extrude_element_1.extrudeElement; } });
|
|
9
|
-
var map_face_1 = require("./map-face");
|
|
10
|
-
Object.defineProperty(exports, "transformPath", { enumerable: true, get: function () { return map_face_1.transformPath; } });
|
|
11
|
-
var matrix_1 = require("./matrix");
|
|
12
|
-
Object.defineProperty(exports, "aroundCenterPoint", { enumerable: true, get: function () { return matrix_1.aroundCenterPoint; } });
|
|
13
|
-
Object.defineProperty(exports, "interpolateMatrix4d", { enumerable: true, get: function () { return matrix_1.interpolateMatrix4d; } });
|
|
14
|
-
Object.defineProperty(exports, "makeMatrix3dTransform", { enumerable: true, get: function () { return matrix_1.makeMatrix3dTransform; } });
|
|
15
|
-
Object.defineProperty(exports, "reduceMatrices", { enumerable: true, get: function () { return matrix_1.reduceMatrices; } });
|
|
16
|
-
Object.defineProperty(exports, "rotateX", { enumerable: true, get: function () { return matrix_1.rotateX; } });
|
|
17
|
-
Object.defineProperty(exports, "rotateY", { enumerable: true, get: function () { return matrix_1.rotateY; } });
|
|
18
|
-
Object.defineProperty(exports, "rotateZ", { enumerable: true, get: function () { return matrix_1.rotateZ; } });
|
|
19
|
-
Object.defineProperty(exports, "scaleX", { enumerable: true, get: function () { return matrix_1.scaleX; } });
|
|
20
|
-
Object.defineProperty(exports, "scaleY", { enumerable: true, get: function () { return matrix_1.scaleY; } });
|
|
21
|
-
Object.defineProperty(exports, "scaled", { enumerable: true, get: function () { return matrix_1.scaled; } });
|
|
22
|
-
Object.defineProperty(exports, "translateX", { enumerable: true, get: function () { return matrix_1.translateX; } });
|
|
23
|
-
Object.defineProperty(exports, "translateY", { enumerable: true, get: function () { return matrix_1.translateY; } });
|
|
24
|
-
Object.defineProperty(exports, "translateZ", { enumerable: true, get: function () { return matrix_1.translateZ; } });
|
package/dist/cjs/make-id.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const makeId: () => string;
|
package/dist/cjs/make-id.js
DELETED
package/dist/cjs/map-face.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type ThreeDReducedInstruction } from './3d-svg';
|
|
2
|
-
import type { MatrixTransform4D, Vector4D } from './matrix';
|
|
3
|
-
export type FaceType = {
|
|
4
|
-
color: string;
|
|
5
|
-
points: ThreeDReducedInstruction[];
|
|
6
|
-
centerPoint: Vector4D;
|
|
7
|
-
crispEdges: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare const translateSvgInstruction: (instruction: ThreeDReducedInstruction, x: number, y: number, z: number) => ThreeDReducedInstruction;
|
|
10
|
-
export declare const transformPath: ({ path, transformation, }: {
|
|
11
|
-
path: string;
|
|
12
|
-
transformation: MatrixTransform4D;
|
|
13
|
-
}) => string;
|
|
14
|
-
export declare const transformFace: (face: FaceType, transformations: MatrixTransform4D[]) => FaceType;
|
|
15
|
-
export declare const transformFaces: ({ faces, transformations, }: {
|
|
16
|
-
faces: FaceType[];
|
|
17
|
-
transformations: MatrixTransform4D[];
|
|
18
|
-
}) => FaceType[];
|
|
19
|
-
export declare const makeFace: ({ points, fill, crispEdges, }: {
|
|
20
|
-
points: string | ThreeDReducedInstruction[];
|
|
21
|
-
strokeWidth: number;
|
|
22
|
-
strokeColor: string;
|
|
23
|
-
fill: string;
|
|
24
|
-
crispEdges: boolean;
|
|
25
|
-
}) => FaceType;
|
package/dist/cjs/map-face.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeFace = exports.transformFaces = exports.transformFace = exports.transformPath = exports.translateSvgInstruction = void 0;
|
|
4
|
-
const paths_1 = require("@remotion/paths");
|
|
5
|
-
const _3d_svg_1 = require("./3d-svg");
|
|
6
|
-
const fix_z_1 = require("./fix-z");
|
|
7
|
-
const matrix_1 = require("./matrix");
|
|
8
|
-
const translateSvgInstruction = (instruction, x, y, z) => {
|
|
9
|
-
if (instruction.type === 'M') {
|
|
10
|
-
return {
|
|
11
|
-
type: 'M',
|
|
12
|
-
point: [
|
|
13
|
-
instruction.point[0] + x,
|
|
14
|
-
instruction.point[1] + y,
|
|
15
|
-
instruction.point[2] + z,
|
|
16
|
-
instruction.point[3],
|
|
17
|
-
],
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
if (instruction.type === 'L') {
|
|
21
|
-
return {
|
|
22
|
-
type: 'L',
|
|
23
|
-
point: [
|
|
24
|
-
instruction.point[0] + x,
|
|
25
|
-
instruction.point[1] + y,
|
|
26
|
-
instruction.point[2] + z,
|
|
27
|
-
instruction.point[3],
|
|
28
|
-
],
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
if (instruction.type === 'C') {
|
|
32
|
-
return {
|
|
33
|
-
type: 'C',
|
|
34
|
-
point: [
|
|
35
|
-
instruction.point[0] + x,
|
|
36
|
-
instruction.point[1] + y,
|
|
37
|
-
instruction.point[2] + z,
|
|
38
|
-
instruction.point[3],
|
|
39
|
-
],
|
|
40
|
-
cp1: [
|
|
41
|
-
instruction.cp1[0] + x,
|
|
42
|
-
instruction.cp1[1] + y,
|
|
43
|
-
instruction.cp1[2] + z,
|
|
44
|
-
instruction.cp1[3],
|
|
45
|
-
],
|
|
46
|
-
cp2: [
|
|
47
|
-
instruction.cp2[0] + x,
|
|
48
|
-
instruction.cp2[1] + y,
|
|
49
|
-
instruction.cp2[2] + z,
|
|
50
|
-
instruction.cp2[3],
|
|
51
|
-
],
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
if (instruction.type === 'Q') {
|
|
55
|
-
return {
|
|
56
|
-
type: 'Q',
|
|
57
|
-
point: [
|
|
58
|
-
instruction.point[0] + x,
|
|
59
|
-
instruction.point[1] + y,
|
|
60
|
-
instruction.point[2] + z,
|
|
61
|
-
instruction.point[3],
|
|
62
|
-
],
|
|
63
|
-
cp: [
|
|
64
|
-
instruction.cp[0] + x,
|
|
65
|
-
instruction.cp[1] + y,
|
|
66
|
-
instruction.cp[2] + z,
|
|
67
|
-
instruction.cp[3],
|
|
68
|
-
],
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
if (instruction.type === 'Z') {
|
|
72
|
-
return {
|
|
73
|
-
type: 'Z',
|
|
74
|
-
point: [
|
|
75
|
-
instruction.point[0] + x,
|
|
76
|
-
instruction.point[1] + y,
|
|
77
|
-
instruction.point[2] + z,
|
|
78
|
-
instruction.point[3],
|
|
79
|
-
],
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
throw new Error('Unknown instruction type: ' + JSON.stringify(instruction));
|
|
83
|
-
};
|
|
84
|
-
exports.translateSvgInstruction = translateSvgInstruction;
|
|
85
|
-
const transformPath = ({ path, transformation, }) => {
|
|
86
|
-
const parsed = (0, paths_1.parsePath)(path);
|
|
87
|
-
const reduced = (0, paths_1.reduceInstructions)(parsed);
|
|
88
|
-
const threeD = (0, fix_z_1.turnInto3D)(reduced);
|
|
89
|
-
return (0, _3d_svg_1.threeDIntoSvgPath)(threeD.map((p) => {
|
|
90
|
-
return (0, matrix_1.multiplyMatrixAndSvgInstruction)(transformation, p);
|
|
91
|
-
}));
|
|
92
|
-
};
|
|
93
|
-
exports.transformPath = transformPath;
|
|
94
|
-
const transformFace = (face, transformations) => {
|
|
95
|
-
return {
|
|
96
|
-
...face,
|
|
97
|
-
points: face.points.map((p) => {
|
|
98
|
-
return transformations.reduce((acc, t) => {
|
|
99
|
-
return (0, matrix_1.multiplyMatrixAndSvgInstruction)(t, acc);
|
|
100
|
-
}, p);
|
|
101
|
-
}),
|
|
102
|
-
centerPoint: transformations.reduce((acc, t) => {
|
|
103
|
-
const result = (0, matrix_1.multiplyMatrix)(t, acc);
|
|
104
|
-
return result;
|
|
105
|
-
}, face.centerPoint),
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
exports.transformFace = transformFace;
|
|
109
|
-
const transformFaces = ({ faces, transformations, }) => {
|
|
110
|
-
return faces.map((face) => {
|
|
111
|
-
return (0, exports.transformFace)(face, transformations);
|
|
112
|
-
});
|
|
113
|
-
};
|
|
114
|
-
exports.transformFaces = transformFaces;
|
|
115
|
-
const makeFace = ({ points, fill, crispEdges, }) => {
|
|
116
|
-
const centerPoint = [0, 0, 0, 1];
|
|
117
|
-
return {
|
|
118
|
-
centerPoint,
|
|
119
|
-
color: fill,
|
|
120
|
-
points: typeof points === 'string' ? (0, fix_z_1.turnInto3D)((0, paths_1.parsePath)(points)) : points,
|
|
121
|
-
crispEdges,
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
exports.makeFace = makeFace;
|
package/dist/cjs/matrix.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { ThreeDReducedInstruction } from './3d-svg';
|
|
2
|
-
export declare const stride: ({ v, m, width, offset, colStride, }: {
|
|
3
|
-
v: Vector;
|
|
4
|
-
m: MatrixTransform4D;
|
|
5
|
-
width: number;
|
|
6
|
-
offset: number;
|
|
7
|
-
colStride: number;
|
|
8
|
-
}) => MatrixTransform4D;
|
|
9
|
-
export declare const identity4: () => MatrixTransform4D;
|
|
10
|
-
export declare const m44multiply: (...matrices: MatrixTransform4D[]) => MatrixTransform4D;
|
|
11
|
-
export type Vector2D = [number, number];
|
|
12
|
-
export type Vector = [number, number, number];
|
|
13
|
-
export type Vector4D = [number, number, number, number];
|
|
14
|
-
export declare const rotateX: (radians: number) => MatrixTransform4D;
|
|
15
|
-
export declare const rotateY: (radians: number) => MatrixTransform4D;
|
|
16
|
-
export declare const translated4d: (vec: Vector) => MatrixTransform4D;
|
|
17
|
-
export declare const rotateZ: (radians: number) => MatrixTransform4D;
|
|
18
|
-
export type MatrixTransform4D = [
|
|
19
|
-
number,
|
|
20
|
-
number,
|
|
21
|
-
number,
|
|
22
|
-
number,
|
|
23
|
-
number,
|
|
24
|
-
number,
|
|
25
|
-
number,
|
|
26
|
-
number,
|
|
27
|
-
number,
|
|
28
|
-
number,
|
|
29
|
-
number,
|
|
30
|
-
number,
|
|
31
|
-
number,
|
|
32
|
-
number,
|
|
33
|
-
number,
|
|
34
|
-
number
|
|
35
|
-
];
|
|
36
|
-
export declare const multiplyMatrices: (matrix1: MatrixTransform4D, matrix2: MatrixTransform4D) => MatrixTransform4D;
|
|
37
|
-
export declare const reduceMatrices: (matrices: (MatrixTransform4D | null)[]) => MatrixTransform4D;
|
|
38
|
-
export declare const aroundCenterPoint: ({ matrix, x, y, z, }: {
|
|
39
|
-
matrix: MatrixTransform4D;
|
|
40
|
-
x: number;
|
|
41
|
-
y: number;
|
|
42
|
-
z: number;
|
|
43
|
-
}) => MatrixTransform4D;
|
|
44
|
-
export declare const makeMatrix3dTransform: (matrix: MatrixTransform4D) => string;
|
|
45
|
-
export declare const interpolateMatrix4d: (input: number, matrix1: MatrixTransform4D, matrix2: MatrixTransform4D) => MatrixTransform4D;
|
|
46
|
-
export declare const scaled: (value: number | Vector) => MatrixTransform4D;
|
|
47
|
-
export declare const scaleX: (x: number) => MatrixTransform4D;
|
|
48
|
-
export declare const scaleY: (y: number) => MatrixTransform4D;
|
|
49
|
-
export declare const normalize: (v: Vector) => Vector;
|
|
50
|
-
export declare const normalize4d: (v: Vector4D) => Vector4D;
|
|
51
|
-
export declare const dot: (a: number[], b: number[]) => number;
|
|
52
|
-
export declare const translateX: (x: number) => MatrixTransform4D;
|
|
53
|
-
export declare const translateY: (y: number) => MatrixTransform4D;
|
|
54
|
-
export declare const translateZ: (z: number) => MatrixTransform4D;
|
|
55
|
-
export type Camera = {
|
|
56
|
-
near: number;
|
|
57
|
-
far: number;
|
|
58
|
-
angle: number;
|
|
59
|
-
eye: Vector;
|
|
60
|
-
coa: Vector;
|
|
61
|
-
up: Vector;
|
|
62
|
-
};
|
|
63
|
-
export declare const mulScalar: <T extends number[]>(v: T, s: number) => T;
|
|
64
|
-
export declare function multiplyMatrixAndSvgInstruction(matrix: MatrixTransform4D, point: ThreeDReducedInstruction): ThreeDReducedInstruction;
|
|
65
|
-
export declare const multiplyMatrix: (matrix: MatrixTransform4D, point: Vector4D) => Vector4D;
|
|
66
|
-
export declare const sub4d: (a: Vector4D, b: Vector4D) => Vector4D;
|