retiam 1.0.2 → 2.0.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/COMMERCIAL_LICENSE.md +61 -0
- package/LICENSE +116 -0
- package/THIRD_PARTY_LICENSES.txt +17771 -0
- package/THIRD_PARTY_NOTICES.md +318 -0
- package/bin/export.js +4 -3
- package/bin/init.js +28 -4
- package/bin/prepare-notices.js +11 -0
- package/bin/third-party.d.ts +6 -0
- package/bin/third-party.js +92 -0
- package/dist/COMMERCIAL_LICENSE.md +61 -0
- package/dist/LICENSE +116 -0
- package/dist/THIRD_PARTY_LICENSES.txt +17771 -0
- package/dist/THIRD_PARTY_NOTICES.md +318 -0
- package/dist/{UTIF-X7q9996p.js → UTIF-2Ear_0Uo.js} +2 -1
- package/dist/{decompress-D5RzmD-2.js → decompress-CuY1lEpT.js} +1 -0
- package/dist/{index-Be4c9A99.js → index-B2sJBy4c.js} +15736 -16052
- package/dist/libs/charts/index.js +1 -0
- package/dist/libs/graphs/index.js +1 -0
- package/dist/libs/highlights/index.js +1 -0
- package/dist/libs/physics/index.js +1 -0
- package/dist/libs/rough/index.js +1 -0
- package/dist/libs/shapes/index.js +1 -0
- package/dist/libs/tts/index.js +1 -0
- package/dist/{main-IC5HXR90.js → main-D_G4uIju.js} +2 -1
- package/dist/{opentype.module-D6jx0UDN.js → opentype.module-DA3p9H4x.js} +1 -0
- package/dist/retiam.es.js +808 -802
- package/dist/src/engine/_core/VectorEntity.d.ts +14 -0
- package/dist/src/engine/animation/transform/TransformMatchingShapes.d.ts +14 -0
- package/dist/src/engine/animation/transform/TransformMatchingTex.d.ts +15 -0
- package/dist/src/engine/animation/transform/TransformMatchingText.d.ts +14 -0
- package/dist/src/engine/entities/composites/coordinates/Axes.d.ts +20 -0
- package/dist/src/engine/entities/composites/geometry/Arrow.d.ts +35 -0
- package/dist/src/engine/entities/composites/geometry/Arrow3D.d.ts +31 -0
- package/dist/src/engine/entities/composites/text/MarkupText.d.ts +0 -1
- package/dist/src/engine/entities/composites/text/Tex.d.ts +2 -3
- package/dist/src/engine/entities/composites/text/TexFontPatcher.d.ts +1 -5
- package/dist/src/engine/font/types.d.ts +1 -1
- package/dist/src/engine/utils/IndexInspector.d.ts +44 -0
- package/dist/src/engine/utils/PathEqualizer.d.ts +15 -0
- package/dist/src/index.d.ts +1 -1
- package/package.json +20 -5
- package/readme.md +24 -1
- package/dist/assets/Virgil.woff2 +0 -0
- package/dist/src/engine/entities/composites/text/virgilMathJaxData.d.ts +0 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IndexInfo, ShowIndicesOptions } from '../utils/IndexInspector';
|
|
1
2
|
import { Entity, EntityOptions } from './Entity';
|
|
2
3
|
import { Path } from '../entities/primitives/2d/Path';
|
|
3
4
|
import { Camera } from '../camera/Camera';
|
|
@@ -5,6 +6,10 @@ import { Vec2 } from '../math/vector/Vec2';
|
|
|
5
6
|
import { Vec3 } from '../math/vector/Vec3';
|
|
6
7
|
import { ISpatialField, SpatialMappingFunction, HomotopyFunction, ComplexMappingFunction } from '../math/fields/SpatialField';
|
|
7
8
|
import { SubdivisionOptions } from '../utils/SubdivisionEngine';
|
|
9
|
+
export declare function registerIndexInspector(inspector: {
|
|
10
|
+
inspect: (e: any) => any;
|
|
11
|
+
show: (e: any, opt?: any) => any;
|
|
12
|
+
}): void;
|
|
8
13
|
/**
|
|
9
14
|
* Abstract base class for all 2D vector-based entities.
|
|
10
15
|
* Guarantees support for mathematical path extraction, morphing, and sub-path animations.
|
|
@@ -148,4 +153,13 @@ export declare abstract class VectorEntity extends Entity {
|
|
|
148
153
|
* @param fn Callback invoked for each leaf Path instance along with its sequential index.
|
|
149
154
|
*/
|
|
150
155
|
forEachPath(fn: (path: Path, index: number) => void): this;
|
|
156
|
+
/**
|
|
157
|
+
* Inspects all sub-paths and prints a formatted table to console.table.
|
|
158
|
+
*/
|
|
159
|
+
inspectIndices(): IndexInfo[];
|
|
160
|
+
/**
|
|
161
|
+
* Generates an overlaid VGroup of numbered badges corresponding to each sub-path index.
|
|
162
|
+
* Add directly to the scene to visually identify path indices.
|
|
163
|
+
*/
|
|
164
|
+
showIndices(options?: ShowIndicesOptions): any;
|
|
151
165
|
}
|
|
@@ -3,8 +3,22 @@ import { Entity } from '../../_core/Entity';
|
|
|
3
3
|
import { AnimOptions } from '../AnimOptions';
|
|
4
4
|
import { State } from '../../_core/State';
|
|
5
5
|
import { VectorEntity } from '../../_core/VectorEntity';
|
|
6
|
+
import { IndexMap, KeyMap } from './TransformMatchingTex';
|
|
6
7
|
export interface TransformMatchingShapesOptions extends AnimOptions {
|
|
7
8
|
morphUnmatched?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Explicit path/contour index pair mappings [sourceIndex, targetIndex][].
|
|
11
|
+
* Direct surgical control: forces source shape path at sourceIndex to map to targetIndex.
|
|
12
|
+
* Takes highest precedence before geometric/label matching.
|
|
13
|
+
* @example [[0, 2]] or { 0: 2 }
|
|
14
|
+
*/
|
|
15
|
+
indexMap?: IndexMap;
|
|
16
|
+
/**
|
|
17
|
+
* Explicit shape label or constructor name mapping.
|
|
18
|
+
* Maps source shape LABEL/name to target shape LABEL/name.
|
|
19
|
+
* @example { "circle": "square", "leftArm": "rightArm" }
|
|
20
|
+
*/
|
|
21
|
+
keyMap?: KeyMap;
|
|
8
22
|
}
|
|
9
23
|
export declare class TransformMatchingShapes extends Concurrent {
|
|
10
24
|
private sourceEntity;
|
|
@@ -2,8 +2,23 @@ import { Concurrent } from '../Concurrent';
|
|
|
2
2
|
import { Tex } from '../../entities/composites/text/Tex';
|
|
3
3
|
import { Text } from '../../entities/composites/text/Text';
|
|
4
4
|
import { AnimOptions } from '../AnimOptions';
|
|
5
|
+
export type IndexMap = [number, number][] | Record<number, number> | Map<number, number>;
|
|
6
|
+
export type KeyMap = Record<string, string> | Map<string, string>;
|
|
5
7
|
export interface TransformMatchingTexOptions extends AnimOptions {
|
|
6
8
|
morphUnmatched?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Explicit index pair mappings [sourceIndex, targetIndex][].
|
|
11
|
+
* Direct surgical control: forces path at sourceIndex to map to targetIndex.
|
|
12
|
+
* Takes highest precedence before key/anchor matching.
|
|
13
|
+
* @example [[2, 5]] or { 2: 5 }
|
|
14
|
+
*/
|
|
15
|
+
indexMap?: IndexMap;
|
|
16
|
+
/**
|
|
17
|
+
* Explicit symbol/substring translation map.
|
|
18
|
+
* Maps source symbol/substring to target symbol/substring.
|
|
19
|
+
* @example { "+": "-", "b^2": "b^2", "\\alpha": "\\beta" }
|
|
20
|
+
*/
|
|
21
|
+
keyMap?: KeyMap;
|
|
7
22
|
}
|
|
8
23
|
export declare class TransformMatchingTex extends Concurrent {
|
|
9
24
|
/** Resolves the absolute world state matrix mapping. */
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { Concurrent } from '../Concurrent';
|
|
2
2
|
import { Text } from '../../entities/composites/text/Text';
|
|
3
3
|
import { AnimOptions } from '../AnimOptions';
|
|
4
|
+
import { IndexMap, KeyMap } from './TransformMatchingTex';
|
|
4
5
|
export interface TransformMatchingOptions extends AnimOptions {
|
|
5
6
|
morphUnmatched?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Explicit index pair mappings [sourceCharIndex, targetCharIndex][].
|
|
9
|
+
* Direct surgical control: forces char at sourceCharIndex to map to targetCharIndex.
|
|
10
|
+
* Takes highest precedence before key/anchor matching.
|
|
11
|
+
* @example [[0, 3]] or { 0: 3 }
|
|
12
|
+
*/
|
|
13
|
+
indexMap?: IndexMap;
|
|
14
|
+
/**
|
|
15
|
+
* Explicit substring or character translation map.
|
|
16
|
+
* Maps source substring/character to target substring/character.
|
|
17
|
+
* @example { "apple": "orange", "A": "B" }
|
|
18
|
+
*/
|
|
19
|
+
keyMap?: KeyMap;
|
|
6
20
|
}
|
|
7
21
|
export declare class TransformMatchingText extends Concurrent {
|
|
8
22
|
/**
|
|
@@ -5,6 +5,7 @@ import { Vec3 } from '../../../math/vector/Vec3';
|
|
|
5
5
|
import { VGroup } from '../../layout/VGroup';
|
|
6
6
|
import { Path } from '../../primitives/2d/Path';
|
|
7
7
|
import { PathEffect } from '../../../material/PathEffect';
|
|
8
|
+
import { Arrow, ArrowTipType } from '../geometry/Arrow';
|
|
8
9
|
/**
|
|
9
10
|
* Configuration options for the [[Axes]] 2D coordinate system.
|
|
10
11
|
*/
|
|
@@ -39,6 +40,16 @@ export interface AxesOptions extends CoordinateSystemOptions {
|
|
|
39
40
|
yLabelFormatter?: AxisLabelFormatter;
|
|
40
41
|
/** Custom formatter callback for 2D coordinate pairs. */
|
|
41
42
|
labelFormatter?: CoordinateLabelFormatter;
|
|
43
|
+
/** Tip style for the main axis arrows ('stealth' | 'triangle' | 'line' | etc.). Default: 'stealth' */
|
|
44
|
+
tipType?: ArrowTipType;
|
|
45
|
+
/** Physical length of arrowhead along the axis. */
|
|
46
|
+
arrowHeadLength?: number;
|
|
47
|
+
/** Physical total width of arrowhead transverse to the axis. */
|
|
48
|
+
arrowHeadWidth?: number;
|
|
49
|
+
/** Whether to render arrowheads on main axes. Default: true */
|
|
50
|
+
showArrows?: boolean;
|
|
51
|
+
/** Alias for showArrows. Default: true */
|
|
52
|
+
includeArrows?: boolean;
|
|
42
53
|
}
|
|
43
54
|
export declare class Axes extends CoordinateSystem {
|
|
44
55
|
axesGroup: VGroup;
|
|
@@ -53,6 +64,14 @@ export declare class Axes extends CoordinateSystem {
|
|
|
53
64
|
xLabelFormatter?: AxisLabelFormatter;
|
|
54
65
|
yLabelFormatter?: AxisLabelFormatter;
|
|
55
66
|
labelFormatter?: CoordinateLabelFormatter;
|
|
67
|
+
tipType: ArrowTipType;
|
|
68
|
+
arrowHeadLength?: number;
|
|
69
|
+
arrowHeadWidth?: number;
|
|
70
|
+
showArrows: boolean;
|
|
71
|
+
xAxis: Arrow;
|
|
72
|
+
yAxis: Arrow;
|
|
73
|
+
get xAxisArrow(): Arrow;
|
|
74
|
+
get yAxisArrow(): Arrow;
|
|
56
75
|
rangeVersion: number;
|
|
57
76
|
private linePool;
|
|
58
77
|
private activeLineCount;
|
|
@@ -83,6 +102,7 @@ export declare class Axes extends CoordinateSystem {
|
|
|
83
102
|
* Adds numerical coordinate labels along the X and Y axes.
|
|
84
103
|
*/
|
|
85
104
|
addCoordinates(options?: CoordinateLabelOptions): this;
|
|
105
|
+
setTipType(type: ArrowTipType): this;
|
|
86
106
|
toPaths(): Path[];
|
|
87
107
|
getSubEntities(): VectorEntity[];
|
|
88
108
|
}
|
|
@@ -3,6 +3,10 @@ import { VectorEntity } from '../../../_core/VectorEntity';
|
|
|
3
3
|
import { Path } from '../../primitives/2d/Path';
|
|
4
4
|
import { Vec3, Vec3Type } from '../../../math/vector/Vec3';
|
|
5
5
|
import { Color } from '../../../math/Color';
|
|
6
|
+
import { Animation } from '../../../animation/Animation';
|
|
7
|
+
import { CreateOptions } from '../../../animation/creation/Create';
|
|
8
|
+
import { TrackBuilder } from '../../../animation/TrackBuilder';
|
|
9
|
+
import { PathEffect } from '../../../material/PathEffect';
|
|
6
10
|
export type ArrowTipType = 'triangle' | 'stealth' | 'line' | 'circle' | 'dot' | 'diamond' | 'bar' | 'tee' | 'square' | 'none';
|
|
7
11
|
export interface ArrowOptions extends EntityOptions {
|
|
8
12
|
points?: Vec3Type[];
|
|
@@ -10,6 +14,7 @@ export interface ArrowOptions extends EntityOptions {
|
|
|
10
14
|
tension?: number;
|
|
11
15
|
segments?: number;
|
|
12
16
|
color?: Color;
|
|
17
|
+
strokeShader?: PathEffect | string;
|
|
13
18
|
headLength?: number;
|
|
14
19
|
headWidth?: number;
|
|
15
20
|
headAngle?: number;
|
|
@@ -76,6 +81,7 @@ export declare class Arrow extends VectorEntity {
|
|
|
76
81
|
private lastT2;
|
|
77
82
|
private lastT1;
|
|
78
83
|
private lastStrokeWidth;
|
|
84
|
+
private lastOpacity;
|
|
79
85
|
constructor(start?: Vec3Type, end?: Vec3Type, options?: ArrowOptions);
|
|
80
86
|
setPoints(points: Vec3Type[]): void;
|
|
81
87
|
putStartAndEndOn(start: Vec3Type, end: Vec3Type): void;
|
|
@@ -90,6 +96,7 @@ export declare class Arrow extends VectorEntity {
|
|
|
90
96
|
width?: number;
|
|
91
97
|
color?: Color;
|
|
92
98
|
}): void;
|
|
99
|
+
setStrokeShader(shader?: PathEffect | string): void;
|
|
93
100
|
private addLineSegment;
|
|
94
101
|
private rebuildCurve;
|
|
95
102
|
private buildTipGeometry;
|
|
@@ -98,6 +105,14 @@ export declare class Arrow extends VectorEntity {
|
|
|
98
105
|
private rebuildSingleHead;
|
|
99
106
|
update(t: number, dt: number): void;
|
|
100
107
|
private syncArrowState;
|
|
108
|
+
/**
|
|
109
|
+
* Creation animation hook for TrackBuilder and `Create(arrow)` / `createAnim(arrow)`.
|
|
110
|
+
*/
|
|
111
|
+
createAnim(t?: TrackBuilder, options?: CreateOptions): Animation;
|
|
112
|
+
/**
|
|
113
|
+
* Erase/uncreate animation hook for `Uncreate(arrow)`.
|
|
114
|
+
*/
|
|
115
|
+
uncreateAnim(options?: CreateOptions): Animation;
|
|
101
116
|
/**
|
|
102
117
|
* Resolves the distinct animatable path structures inside the Arrow (the shaft and the tip(s)).
|
|
103
118
|
*/
|
|
@@ -107,3 +122,23 @@ export declare class Arrow extends VectorEntity {
|
|
|
107
122
|
*/
|
|
108
123
|
toPaths(): Path[];
|
|
109
124
|
}
|
|
125
|
+
export declare class ArrowCreateAnimation extends Animation {
|
|
126
|
+
private arrow;
|
|
127
|
+
private targetT1;
|
|
128
|
+
private targetT2;
|
|
129
|
+
private originalStroke;
|
|
130
|
+
private originalStrokeWidth;
|
|
131
|
+
private targetStroke;
|
|
132
|
+
private targetStrokeWidth;
|
|
133
|
+
constructor(arrow: Arrow, options?: CreateOptions);
|
|
134
|
+
prepare(): void;
|
|
135
|
+
update(dt: number): boolean;
|
|
136
|
+
}
|
|
137
|
+
export declare class ArrowUncreateAnimation extends Animation {
|
|
138
|
+
private arrow;
|
|
139
|
+
private startT1;
|
|
140
|
+
private startT2;
|
|
141
|
+
constructor(arrow: Arrow, options?: CreateOptions);
|
|
142
|
+
prepare(): void;
|
|
143
|
+
update(dt: number): boolean;
|
|
144
|
+
}
|
|
@@ -5,6 +5,9 @@ import { Vec3Type } from '../../../math/vector/Vec3';
|
|
|
5
5
|
import { Color } from '../../../math/Color';
|
|
6
6
|
import { VectorEntity } from '../../../_core/VectorEntity';
|
|
7
7
|
import { Path } from '../../primitives/2d/Path';
|
|
8
|
+
import { Animation } from '../../../animation/Animation';
|
|
9
|
+
import { CreateOptions } from '../../../animation/creation/Create';
|
|
10
|
+
import { TrackBuilder } from '../../../animation/TrackBuilder';
|
|
8
11
|
export interface Arrow3DOptions extends EntityOptions {
|
|
9
12
|
points?: Vec3Type[];
|
|
10
13
|
isSmooth?: boolean;
|
|
@@ -29,6 +32,34 @@ export declare class Arrow3D extends VectorEntity {
|
|
|
29
32
|
private rebuildCurve;
|
|
30
33
|
update(t: number, dt: number): void;
|
|
31
34
|
private syncArrowState;
|
|
35
|
+
/**
|
|
36
|
+
* Creation animation hook for TrackBuilder and `Create(arrow3D)` / `createAnim(arrow3D)`.
|
|
37
|
+
*/
|
|
38
|
+
createAnim(t?: TrackBuilder, options?: CreateOptions): Animation;
|
|
39
|
+
/**
|
|
40
|
+
* Erase/uncreate animation hook for `Uncreate(arrow3D)`.
|
|
41
|
+
*/
|
|
42
|
+
uncreateAnim(options?: CreateOptions): Animation;
|
|
32
43
|
getSubEntities(): VectorEntity[];
|
|
33
44
|
toPaths(): Path[];
|
|
34
45
|
}
|
|
46
|
+
export declare class Arrow3DCreateAnimation extends Animation {
|
|
47
|
+
private arrow;
|
|
48
|
+
private targetT1;
|
|
49
|
+
private targetT2;
|
|
50
|
+
private originalStroke;
|
|
51
|
+
private originalStrokeWidth;
|
|
52
|
+
private targetStroke;
|
|
53
|
+
private targetStrokeWidth;
|
|
54
|
+
constructor(arrow: Arrow3D, options?: CreateOptions);
|
|
55
|
+
prepare(): void;
|
|
56
|
+
update(dt: number): boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare class Arrow3DUncreateAnimation extends Animation {
|
|
59
|
+
private arrow;
|
|
60
|
+
private startT1;
|
|
61
|
+
private startT2;
|
|
62
|
+
constructor(arrow: Arrow3D, options?: CreateOptions);
|
|
63
|
+
prepare(): void;
|
|
64
|
+
update(dt: number): boolean;
|
|
65
|
+
}
|
|
@@ -29,7 +29,6 @@ export interface MarkupTextOptions extends EntityOptions, ShaderConfigOptions {
|
|
|
29
29
|
* Typographic font style for LaTeX mathematical formulas:
|
|
30
30
|
* - 'default': Standard Computer Modern TeX font.
|
|
31
31
|
* - 'excalifont': Handwritten Excalidraw math font.
|
|
32
|
-
* - 'virgil': Handwritten Virgil math font.
|
|
33
32
|
* @default 'default'
|
|
34
33
|
*/
|
|
35
34
|
texStyle?: TexStyle;
|
|
@@ -4,13 +4,12 @@ import { TextOptions } from './Text';
|
|
|
4
4
|
import { VectorEntity } from '../../../_core/VectorEntity';
|
|
5
5
|
import { PathEffect } from '../../../material/PathEffect';
|
|
6
6
|
import { FillEffect } from '../../../material/FillEffect';
|
|
7
|
-
export type TexStyle = 'default' | 'excalifont'
|
|
7
|
+
export type TexStyle = 'default' | 'excalifont';
|
|
8
8
|
export interface TexOptions extends TextOptions {
|
|
9
9
|
/**
|
|
10
10
|
* Typographic font style for LaTeX formulas:
|
|
11
11
|
* - 'default': Standard Computer Modern TeX font.
|
|
12
12
|
* - 'excalifont': Handwritten Excalidraw font for numbers, letters, Greek symbols, and operators.
|
|
13
|
-
* - 'virgil': Handwritten Virgil font for numbers, letters, Greek symbols, and operators.
|
|
14
13
|
* @default 'default'
|
|
15
14
|
*/
|
|
16
15
|
fontStyle?: TexStyle;
|
|
@@ -52,7 +51,7 @@ export declare class Tex extends VectorEntity {
|
|
|
52
51
|
private _cachedPaths;
|
|
53
52
|
constructor(cmd?: string, options?: TexOptions);
|
|
54
53
|
/**
|
|
55
|
-
* Switches the font style ('default'
|
|
54
|
+
* Switches the font style ('default' or 'excalifont') and rebuilds the formula geometry.
|
|
56
55
|
*/
|
|
57
56
|
setFontStyle(fontStyle: TexStyle): this;
|
|
58
57
|
/**
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utility for patching MathJax SVG font definitions with custom vector fonts
|
|
3
|
-
* such as Excalifont
|
|
3
|
+
* such as Excalifont (an Excalidraw handwritten font).
|
|
4
4
|
*/
|
|
5
5
|
export declare class TexFontPatcher {
|
|
6
6
|
/**
|
|
7
7
|
* Injects Excalifont vector outlines and glyph metrics into a MathJax SVG output instance.
|
|
8
8
|
*/
|
|
9
9
|
static patchExcalifont(svg: any): void;
|
|
10
|
-
/**
|
|
11
|
-
* Injects Virgil vector outlines and glyph metrics into a MathJax SVG output instance.
|
|
12
|
-
*/
|
|
13
|
-
static patchVirgil(svg: any): void;
|
|
14
10
|
private static applyGlyphs;
|
|
15
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Font as OpentypeFont } from 'opentype.js';
|
|
2
2
|
export type VectorFont = OpentypeFont;
|
|
3
|
-
export type BuiltinFont = 'roboto' | 'excalifont' | '
|
|
3
|
+
export type BuiltinFont = 'roboto' | 'excalifont' | 'Fredericka the Great' | 'fredericka the great' | 'fredericka' | 'firacode' | 'Fira Code';
|
|
4
4
|
export type FontStyle = BuiltinFont | (string & {});
|
|
5
5
|
export type FontSource = string | ArrayBuffer | Uint8Array | Blob;
|
|
6
6
|
export interface MSDFOptions {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { VectorEntity } from '../_core/VectorEntity';
|
|
2
|
+
import { VGroup } from '../entities/layout/VGroup';
|
|
3
|
+
import { Color } from '../math/Color';
|
|
4
|
+
import { Vec3 } from '../math/vector/Vec3';
|
|
5
|
+
export interface IndexInfo {
|
|
6
|
+
index: number;
|
|
7
|
+
symbol?: string;
|
|
8
|
+
label: string;
|
|
9
|
+
center: Vec3;
|
|
10
|
+
bounds: Vec3;
|
|
11
|
+
}
|
|
12
|
+
export interface ShowIndicesOptions {
|
|
13
|
+
/** Font size of the numeric badge labels. Default: 9 */
|
|
14
|
+
fontSize?: number;
|
|
15
|
+
/** Foreground text color. Default: Color.fromHex("#facc15") (amber/yellow) */
|
|
16
|
+
color?: Color;
|
|
17
|
+
/** Overall badge opacity (0 = transparent, 1 = opaque). Default: 0.75 */
|
|
18
|
+
opacity?: number;
|
|
19
|
+
/** Whether to draw a circular badge backdrop behind each number. Default: true */
|
|
20
|
+
background?: boolean;
|
|
21
|
+
/** Badge background circle fill color. Default: Color.fromHex("#111827aa") (semi-transparent dark) */
|
|
22
|
+
backgroundColor?: Color;
|
|
23
|
+
/** Badge background circle stroke outline color. Default: Color.fromHex("#eab308cc") */
|
|
24
|
+
borderColor?: Color;
|
|
25
|
+
/** Badge circle radius in world units. Default: 7.5 */
|
|
26
|
+
radius?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Inspects all sub-paths of a VectorEntity (Tex, Text, SVG, VGroup, etc.)
|
|
30
|
+
* and logs a formatted table to console.table showing their indices, symbols, centers, and bounds.
|
|
31
|
+
*
|
|
32
|
+
* @param entity The vector entity to inspect.
|
|
33
|
+
* @returns Array of metadata objects for each child path.
|
|
34
|
+
*/
|
|
35
|
+
export declare function inspectIndices(entity: VectorEntity): IndexInfo[];
|
|
36
|
+
/**
|
|
37
|
+
* Generates an overlaid VGroup of numbered circular badges corresponding to each sub-path index.
|
|
38
|
+
* Useful during scene development to visually identify path indices directly on the canvas.
|
|
39
|
+
*
|
|
40
|
+
* @param entity The vector entity whose sub-path indices to show.
|
|
41
|
+
* @param options Styling options for the index badges.
|
|
42
|
+
* @returns A VGroup containing the visual badges.
|
|
43
|
+
*/
|
|
44
|
+
export declare function showIndices(entity: VectorEntity, options?: ShowIndicesOptions): VGroup;
|
|
@@ -18,6 +18,16 @@ export declare class PathEqualizer {
|
|
|
18
18
|
private static padPaths;
|
|
19
19
|
private static matchPathsSpatially;
|
|
20
20
|
private static getCentroid;
|
|
21
|
+
/**
|
|
22
|
+
* Solves minimum-weight bipartite matching.
|
|
23
|
+
* Uses exact permutation search for small N <= 8, or greedy fallback for larger.
|
|
24
|
+
*/
|
|
25
|
+
private static solveBipartite;
|
|
26
|
+
/**
|
|
27
|
+
* Hierarchical contour classification and matching.
|
|
28
|
+
* Outer boundaries strictly match Outer boundaries; Holes strictly match Holes.
|
|
29
|
+
* Matching is evaluated in normalized relative space to eliminate translation distortion.
|
|
30
|
+
*/
|
|
21
31
|
private static equalizePathContours;
|
|
22
32
|
private static padContours;
|
|
23
33
|
private static getControidOfContour;
|
|
@@ -26,6 +36,11 @@ export declare class PathEqualizer {
|
|
|
26
36
|
private static getSignedArea;
|
|
27
37
|
private static reverseContour;
|
|
28
38
|
private static shiftClosedPath;
|
|
39
|
+
/**
|
|
40
|
+
* Determines optimal cyclic shift for closed contours.
|
|
41
|
+
* Evaluates alignment in zero-centered local coordinates to prevent translation distance
|
|
42
|
+
* from skewing the cyclic dot product.
|
|
43
|
+
*/
|
|
29
44
|
private static findOptimalShift;
|
|
30
45
|
/**
|
|
31
46
|
* O(N) Single-Pass Subdivision.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -205,7 +205,6 @@ export * from './engine/entities/composites/text/TexFontPatcher';
|
|
|
205
205
|
export * from './engine/entities/composites/text/Text';
|
|
206
206
|
export * from './engine/entities/composites/text/TextSplitter';
|
|
207
207
|
export * from './engine/entities/composites/text/excalifontMathJaxData';
|
|
208
|
-
export * from './engine/entities/composites/text/virgilMathJaxData';
|
|
209
208
|
export * from './engine/entities/composites/trackers/ValueTrackers';
|
|
210
209
|
export * from './engine/entities/composites/trackers/alwaysRedraw';
|
|
211
210
|
export * from './engine/entities/layout/Arrange';
|
|
@@ -423,6 +422,7 @@ export * from './engine/utils/Builder';
|
|
|
423
422
|
export * from './engine/utils/Builder3D';
|
|
424
423
|
export * from './engine/utils/CurveSampleUtils';
|
|
425
424
|
export * from './engine/utils/CurveUtil';
|
|
425
|
+
export * from './engine/utils/IndexInspector';
|
|
426
426
|
export * from './engine/utils/GeometrySnapshot';
|
|
427
427
|
export * from './engine/utils/MarchingSquares';
|
|
428
428
|
export * from './engine/utils/OBJLoader';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "retiam",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "WebGPU powered animation engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/retiam.es.js",
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
"import": "./dist/retiam.es.js"
|
|
13
13
|
},
|
|
14
14
|
"./dist/assets/*": "./dist/assets/*",
|
|
15
|
+
"./license-notices": {
|
|
16
|
+
"types": "./bin/third-party.d.ts",
|
|
17
|
+
"import": "./bin/third-party.js"
|
|
18
|
+
},
|
|
15
19
|
"./*": {
|
|
16
20
|
"types": "./dist/libs/*/index.d.ts",
|
|
17
21
|
"import": "./dist/libs/*/index.js"
|
|
@@ -26,11 +30,19 @@
|
|
|
26
30
|
"dist/libs/**/*.js",
|
|
27
31
|
"dist/libs/**/*.d.ts",
|
|
28
32
|
"dist/src/**/*.d.ts",
|
|
29
|
-
"bin"
|
|
33
|
+
"bin",
|
|
34
|
+
"LICENSE",
|
|
35
|
+
"COMMERCIAL_LICENSE.md",
|
|
36
|
+
"THIRD_PARTY_NOTICES.md",
|
|
37
|
+
"THIRD_PARTY_LICENSES.txt",
|
|
38
|
+
"dist/LICENSE",
|
|
39
|
+
"dist/COMMERCIAL_LICENSE.md",
|
|
40
|
+
"dist/THIRD_PARTY_NOTICES.md",
|
|
41
|
+
"dist/THIRD_PARTY_LICENSES.txt"
|
|
30
42
|
],
|
|
31
43
|
"scripts": {
|
|
32
44
|
"dev": "vite",
|
|
33
|
-
"build": "tsc && vite build",
|
|
45
|
+
"build": "npm run licenses:check && tsc && vite build",
|
|
34
46
|
"prepack": "npm run build",
|
|
35
47
|
"build:watch": "vite build --watch",
|
|
36
48
|
"export": "node ./bin/cli.js export",
|
|
@@ -47,12 +59,15 @@
|
|
|
47
59
|
"test:create": "node --test test/create_retiam_test.mjs",
|
|
48
60
|
"test:shading": "npm run build && node --test test/shading_test.mjs test/shading_browser.test.mjs",
|
|
49
61
|
"test:studio-layout": "node --test test/studio_layout.test.mjs",
|
|
62
|
+
"licenses:generate": "node tools/generate-third-party-notices.mjs",
|
|
63
|
+
"licenses:check": "node tools/generate-third-party-notices.mjs --check",
|
|
64
|
+
"test:licenses": "node --test test/third_party_notices_test.mjs",
|
|
50
65
|
"unit-test": "ts-node-esm test/test.ts",
|
|
51
66
|
"gen-context": "ts-node tools/context_gen/context_generator.ts ./src",
|
|
52
67
|
"gen-index": "node ./tools/index_generator/generate-index.cjs"
|
|
53
68
|
},
|
|
54
69
|
"author": "Abhilas Biswas",
|
|
55
|
-
"license": "
|
|
70
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
56
71
|
"devDependencies": {
|
|
57
72
|
"@lightningjs/msdf-generator": "^1.1.1",
|
|
58
73
|
"@types/earcut": "^3.0.0",
|
|
@@ -105,4 +120,4 @@
|
|
|
105
120
|
"woff2-encoder": "^2.0.0",
|
|
106
121
|
"ws": "^8.16.0"
|
|
107
122
|
}
|
|
108
|
-
}
|
|
123
|
+
}
|
package/readme.md
CHANGED
|
@@ -4,6 +4,22 @@ Retiam is a TypeScript animation engine built on WebGPU. Write scenes for mathem
|
|
|
4
4
|
|
|
5
5
|
**[Documentation](https://abhilasbiswas.github.io/retiam-docs/)** · [Getting started](https://abhilasbiswas.github.io/retiam-docs/getting-started/) · [Examples](https://abhilasbiswas.github.io/retiam-docs/examples-catalog/) · [API reference](https://abhilasbiswas.github.io/retiam-docs/api-core/)
|
|
6
6
|
|
|
7
|
+
Retiam is **free for noncommercial use** under the [Retiam Noncommercial
|
|
8
|
+
License](LICENSE). Commercial development, internal business use, paid client
|
|
9
|
+
work, and products, services or content that earn revenue directly or
|
|
10
|
+
indirectly require a separate paid written commercial license before use.
|
|
11
|
+
This includes advertising, sponsorships, subscriptions, and monetized videos
|
|
12
|
+
or courses, even when Retiam is only one part of a larger project.
|
|
13
|
+
Contact [abhilasbiswas@gmail.com](mailto:abhilasbiswas@gmail.com) for
|
|
14
|
+
[commercial licensing](COMMERCIAL_LICENSE.md).
|
|
15
|
+
|
|
16
|
+
Your independently authored code and original outputs remain your own.
|
|
17
|
+
Earlier ISC permissions and third-party licenses remain unaffected. Keep the
|
|
18
|
+
[third-party notices](THIRD_PARTY_NOTICES.md) and
|
|
19
|
+
[license texts](THIRD_PARTY_LICENSES.txt) with redistributed Retiam code.
|
|
20
|
+
See [licensing and distribution](docs/LICENSING.md) for details, provenance
|
|
21
|
+
review limits, and notice-generation commands.
|
|
22
|
+
|
|
7
23
|
## Features
|
|
8
24
|
|
|
9
25
|
- **Scene authoring:** compose entities, groups, layouts, cameras, and interaction with TypeScript.
|
|
@@ -78,12 +94,16 @@ npm install --save-dev typescript "vite@^6.1.1" @webgpu/types
|
|
|
78
94
|
|
|
79
95
|
Follow the [installation guide](https://abhilasbiswas.github.io/retiam-docs/installation/) for the complete project structure, TypeScript configuration, and browser entry point. To use an unpublished checkout, run `npm pack` in this repository and install the generated `.tgz` file in your application.
|
|
80
96
|
|
|
81
|
-
For Vite applications, preserve Retiam's packaged
|
|
97
|
+
For Vite applications, preserve Retiam's packaged asset URLs and include its
|
|
98
|
+
license and third-party notices in production output with `vite.config.ts`:
|
|
82
99
|
|
|
83
100
|
```typescript
|
|
84
101
|
import { defineConfig } from "vite";
|
|
102
|
+
import { retiamNoticesPlugin } from "retiam/license-notices";
|
|
85
103
|
|
|
86
104
|
export default defineConfig({
|
|
105
|
+
plugins: [retiamNoticesPlugin()],
|
|
106
|
+
esbuild: { legalComments: "inline" },
|
|
87
107
|
optimizeDeps: { exclude: ["retiam"] },
|
|
88
108
|
});
|
|
89
109
|
```
|
|
@@ -273,9 +293,12 @@ Save this as `vite.embed.config.ts`:
|
|
|
273
293
|
|
|
274
294
|
```typescript
|
|
275
295
|
import { defineConfig } from 'vite';
|
|
296
|
+
import { retiamNoticesPlugin } from 'retiam/license-notices';
|
|
276
297
|
|
|
277
298
|
export default defineConfig({
|
|
278
299
|
base: './',
|
|
300
|
+
plugins: [retiamNoticesPlugin()],
|
|
301
|
+
esbuild: { legalComments: 'inline' },
|
|
279
302
|
build: {
|
|
280
303
|
target: 'es2022',
|
|
281
304
|
outDir: 'outputs/embed',
|
package/dist/assets/Virgil.woff2
DELETED
|
Binary file
|