manim-web 0.3.6 → 0.3.7
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/animation/Animation.d.ts +16 -1
- package/dist/animation/Animation.d.ts.map +1 -1
- package/dist/animation/MasterTimeline.d.ts +70 -0
- package/dist/animation/MasterTimeline.d.ts.map +1 -0
- package/dist/animation/Timeline.d.ts +1 -1
- package/dist/animation/Timeline.d.ts.map +1 -1
- package/dist/animation/transform/ApplyTransforms.d.ts +91 -0
- package/dist/animation/transform/ApplyTransforms.d.ts.map +1 -0
- package/dist/animation/transform/FadeTransforms.d.ts +76 -0
- package/dist/animation/transform/FadeTransforms.d.ts.map +1 -0
- package/dist/animation/transform/MovementTransforms.d.ts +131 -0
- package/dist/animation/transform/MovementTransforms.d.ts.map +1 -0
- package/dist/animation/transform/SpecialTransforms.d.ts +158 -0
- package/dist/animation/transform/SpecialTransforms.d.ts.map +1 -0
- package/dist/animation/transform/TransformExtensions.d.ts +11 -430
- package/dist/animation/transform/TransformExtensions.d.ts.map +1 -1
- package/dist/animation/transform/index.d.ts +4 -1
- package/dist/animation/transform/index.d.ts.map +1 -1
- package/dist/core/Group.d.ts +4 -1
- package/dist/core/Group.d.ts.map +1 -1
- package/dist/core/InteractiveScene.d.ts.map +1 -1
- package/dist/core/LinearTransformationScene.d.ts +152 -0
- package/dist/core/LinearTransformationScene.d.ts.map +1 -0
- package/dist/core/Mobject.d.ts +26 -389
- package/dist/core/Mobject.d.ts.map +1 -1
- package/dist/core/MobjectPositioning.d.ts +32 -0
- package/dist/core/MobjectPositioning.d.ts.map +1 -0
- package/dist/core/MobjectState.d.ts +40 -0
- package/dist/core/MobjectState.d.ts.map +1 -0
- package/dist/core/MobjectTypes.d.ts +51 -0
- package/dist/core/MobjectTypes.d.ts.map +1 -0
- package/dist/core/MovingCameraScene.d.ts +77 -0
- package/dist/core/MovingCameraScene.d.ts.map +1 -0
- package/dist/core/Renderer.d.ts +5 -0
- package/dist/core/Renderer.d.ts.map +1 -1
- package/dist/core/Scene.d.ts +25 -0
- package/dist/core/Scene.d.ts.map +1 -1
- package/dist/core/SceneExtensions.d.ts +7 -654
- package/dist/core/SceneExtensions.d.ts.map +1 -1
- package/dist/core/StateManager.d.ts.map +1 -1
- package/dist/core/ThreeDScene.d.ts +199 -0
- package/dist/core/ThreeDScene.d.ts.map +1 -0
- package/dist/core/VMobject.d.ts +48 -200
- package/dist/core/VMobject.d.ts.map +1 -1
- package/dist/core/VMobjectCurves.d.ts +25 -0
- package/dist/core/VMobjectCurves.d.ts.map +1 -0
- package/dist/core/VMobjectGeometry.d.ts +84 -0
- package/dist/core/VMobjectGeometry.d.ts.map +1 -0
- package/dist/core/VMobjectRendering.d.ts +138 -0
- package/dist/core/VMobjectRendering.d.ts.map +1 -0
- package/dist/core/VectorScene.d.ts +106 -0
- package/dist/core/VectorScene.d.ts.map +1 -0
- package/dist/core/ZoomedScene.d.ts +151 -0
- package/dist/core/ZoomedScene.d.ts.map +1 -0
- package/dist/core/index.d.ts +6 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/export/GifExporter.d.ts +4 -3
- package/dist/export/GifExporter.d.ts.map +1 -1
- package/dist/export/VideoExporter.d.ts.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13424 -12758
- package/dist/integrations/react.js +322 -318
- package/dist/integrations/vue.js +316 -312
- package/dist/interaction/Clickable.d.ts.map +1 -1
- package/dist/interaction/Draggable.d.ts.map +1 -1
- package/dist/interaction/Hoverable.d.ts.map +1 -1
- package/dist/interaction/SelectionManager.d.ts.map +1 -1
- package/dist/mobjects/geometry/AnnularSector.d.ts +107 -0
- package/dist/mobjects/geometry/AnnularSector.d.ts.map +1 -0
- package/dist/mobjects/geometry/Annulus.d.ts +89 -0
- package/dist/mobjects/geometry/Annulus.d.ts.map +1 -0
- package/dist/mobjects/geometry/ArcPolygon.d.ts +74 -0
- package/dist/mobjects/geometry/ArcPolygon.d.ts.map +1 -0
- package/dist/mobjects/geometry/ArcShapes.d.ts +11 -657
- package/dist/mobjects/geometry/ArcShapes.d.ts.map +1 -1
- package/dist/mobjects/geometry/BooleanOperations.d.ts.map +1 -1
- package/dist/mobjects/geometry/CurvedArrow.d.ts +95 -0
- package/dist/mobjects/geometry/CurvedArrow.d.ts.map +1 -0
- package/dist/mobjects/geometry/CurvedDoubleArrow.d.ts +60 -0
- package/dist/mobjects/geometry/CurvedDoubleArrow.d.ts.map +1 -0
- package/dist/mobjects/geometry/Ellipse.d.ts +98 -0
- package/dist/mobjects/geometry/Ellipse.d.ts.map +1 -0
- package/dist/mobjects/geometry/Rectangle.d.ts +3 -3
- package/dist/mobjects/geometry/Rectangle.d.ts.map +1 -1
- package/dist/mobjects/geometry/Sector.d.ts +99 -0
- package/dist/mobjects/geometry/Sector.d.ts.map +1 -0
- package/dist/mobjects/geometry/ShapeMatchers.d.ts +5 -1
- package/dist/mobjects/geometry/ShapeMatchers.d.ts.map +1 -1
- package/dist/mobjects/geometry/TangentialArc.d.ts +58 -0
- package/dist/mobjects/geometry/TangentialArc.d.ts.map +1 -0
- package/dist/mobjects/geometry/index.d.ts +10 -3
- package/dist/mobjects/geometry/index.d.ts.map +1 -1
- package/dist/mobjects/graph/DiGraph.d.ts +26 -0
- package/dist/mobjects/graph/DiGraph.d.ts.map +1 -0
- package/dist/mobjects/graph/GenericGraph.d.ts +184 -0
- package/dist/mobjects/graph/GenericGraph.d.ts.map +1 -0
- package/dist/mobjects/graph/Graph.d.ts +10 -0
- package/dist/mobjects/graph/Graph.d.ts.map +1 -0
- package/dist/mobjects/graph/graphFactories.d.ts +49 -0
- package/dist/mobjects/graph/graphFactories.d.ts.map +1 -0
- package/dist/mobjects/graph/graphTypes.d.ts +110 -0
- package/dist/mobjects/graph/graphTypes.d.ts.map +1 -0
- package/dist/mobjects/graph/index.d.ts +6 -417
- package/dist/mobjects/graph/index.d.ts.map +1 -1
- package/dist/mobjects/graph/layoutAlgorithms.d.ts +11 -0
- package/dist/mobjects/graph/layoutAlgorithms.d.ts.map +1 -0
- package/dist/mobjects/graphing/FunctionGraph.d.ts.map +1 -1
- package/dist/mobjects/graphing/ParametricFunction.d.ts +1 -1
- package/dist/mobjects/graphing/ParametricFunction.d.ts.map +1 -1
- package/dist/mobjects/image/index.d.ts +2 -1
- package/dist/mobjects/image/index.d.ts.map +1 -1
- package/dist/mobjects/point/Mobject1D.d.ts +129 -0
- package/dist/mobjects/point/Mobject1D.d.ts.map +1 -0
- package/dist/mobjects/point/Mobject2D.d.ts +170 -0
- package/dist/mobjects/point/Mobject2D.d.ts.map +1 -0
- package/dist/mobjects/point/PGroup.d.ts +111 -0
- package/dist/mobjects/point/PGroup.d.ts.map +1 -0
- package/dist/mobjects/point/PMobject.d.ts +152 -0
- package/dist/mobjects/point/PMobject.d.ts.map +1 -0
- package/dist/mobjects/point/PointCloudDot.d.ts +98 -0
- package/dist/mobjects/point/PointCloudDot.d.ts.map +1 -0
- package/dist/mobjects/point/PointMobject.d.ts +62 -0
- package/dist/mobjects/point/PointMobject.d.ts.map +1 -0
- package/dist/mobjects/point/index.d.ts +7 -701
- package/dist/mobjects/point/index.d.ts.map +1 -1
- package/dist/mobjects/svg/Brace.d.ts.map +1 -1
- package/dist/mobjects/text/Code.d.ts +2 -39
- package/dist/mobjects/text/Code.d.ts.map +1 -1
- package/dist/mobjects/text/CodeHighlighting.d.ts +50 -0
- package/dist/mobjects/text/CodeHighlighting.d.ts.map +1 -0
- package/dist/mobjects/text/CodeLanguageData.d.ts +25 -0
- package/dist/mobjects/text/CodeLanguageData.d.ts.map +1 -0
- package/dist/mobjects/text/MathTex.d.ts +1 -0
- package/dist/mobjects/text/MathTex.d.ts.map +1 -1
- package/dist/mobjects/text/MathTexSVG.d.ts +2 -0
- package/dist/mobjects/text/MathTexSVG.d.ts.map +1 -1
- package/dist/mobjects/text/Variable.d.ts.map +1 -1
- package/dist/mobjects/text/katex-styles.d.ts.map +1 -1
- package/dist/player/Player.d.ts +85 -0
- package/dist/player/Player.d.ts.map +1 -0
- package/dist/player/PlayerController.d.ts +22 -0
- package/dist/player/PlayerController.d.ts.map +1 -0
- package/dist/player/PlayerUI.d.ts +70 -0
- package/dist/player/PlayerUI.d.ts.map +1 -0
- package/dist/player/index.d.ts +4 -0
- package/dist/player/index.d.ts.map +1 -0
- package/dist/utils/hungarian.d.ts.map +1 -1
- package/dist/utils/skeletonize.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { Vector3Tuple } from '../../core/Mobject';
|
|
2
|
+
import { PMobject } from './PMobject';
|
|
3
|
+
/**
|
|
4
|
+
* Distribution type for Mobject2D
|
|
5
|
+
*/
|
|
6
|
+
export type Distribution2D = 'grid' | 'random';
|
|
7
|
+
/**
|
|
8
|
+
* Options for creating a Mobject2D
|
|
9
|
+
*/
|
|
10
|
+
export interface Mobject2DOptions {
|
|
11
|
+
/** Center of the region [x, y, z]. Default: [0, 0, 0] */
|
|
12
|
+
center?: Vector3Tuple;
|
|
13
|
+
/** Width of the region (along x-axis). Default: 2 */
|
|
14
|
+
width?: number;
|
|
15
|
+
/** Height of the region (along y-axis). Default: 2 */
|
|
16
|
+
height?: number;
|
|
17
|
+
/** Number of points along width for grid, or total points for random. Default: 10 */
|
|
18
|
+
numPointsX?: number;
|
|
19
|
+
/** Number of points along height for grid. Default: 10 */
|
|
20
|
+
numPointsY?: number;
|
|
21
|
+
/** Alternative to numPoints: density (points per unit area for random, per unit length for grid). */
|
|
22
|
+
density?: number;
|
|
23
|
+
/** Distribution pattern: 'grid' or 'random'. Default: 'grid' */
|
|
24
|
+
distribution?: Distribution2D;
|
|
25
|
+
/** Color as CSS color string. Default: white (#FFFFFF) */
|
|
26
|
+
color?: string;
|
|
27
|
+
/** Opacity from 0 to 1. Default: 1 */
|
|
28
|
+
opacity?: number;
|
|
29
|
+
/** Size of each point in pixels. Default: 6 */
|
|
30
|
+
pointSize?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Mobject2D - 2D point distribution in a rectangular plane
|
|
34
|
+
*
|
|
35
|
+
* Points are distributed within a rectangular region. Supports
|
|
36
|
+
* grid distribution (evenly spaced rows and columns) or random
|
|
37
|
+
* distribution within the bounds.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* // Create a 10x10 grid of points
|
|
42
|
+
* const grid = new Mobject2D({
|
|
43
|
+
* center: [0, 0, 0],
|
|
44
|
+
* width: 4,
|
|
45
|
+
* height: 4,
|
|
46
|
+
* numPointsX: 10,
|
|
47
|
+
* numPointsY: 10,
|
|
48
|
+
* distribution: 'grid',
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* // Create random points in a region
|
|
52
|
+
* const randomCloud = new Mobject2D({
|
|
53
|
+
* center: [0, 0, 0],
|
|
54
|
+
* width: 3,
|
|
55
|
+
* height: 2,
|
|
56
|
+
* numPointsX: 100, // total points for random
|
|
57
|
+
* distribution: 'random',
|
|
58
|
+
* color: '#ff00ff',
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* // Use density instead of explicit counts
|
|
62
|
+
* const densePlane = new Mobject2D({
|
|
63
|
+
* width: 2,
|
|
64
|
+
* height: 2,
|
|
65
|
+
* density: 5, // 5 points per unit (grid) or 5 per unit area (random)
|
|
66
|
+
* distribution: 'grid',
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare class Mobject2D extends PMobject {
|
|
71
|
+
protected _center2D: Vector3Tuple;
|
|
72
|
+
protected _width: number;
|
|
73
|
+
protected _height: number;
|
|
74
|
+
protected _numPointsX: number;
|
|
75
|
+
protected _numPointsY: number;
|
|
76
|
+
protected _density?: number;
|
|
77
|
+
protected _distribution: Distribution2D;
|
|
78
|
+
constructor(options?: Mobject2DOptions);
|
|
79
|
+
/**
|
|
80
|
+
* Get the area of the region
|
|
81
|
+
*/
|
|
82
|
+
getArea(): number;
|
|
83
|
+
/**
|
|
84
|
+
* Get actual point counts based on density or config
|
|
85
|
+
*/
|
|
86
|
+
protected _getActualPointCounts(): {
|
|
87
|
+
x: number;
|
|
88
|
+
y: number;
|
|
89
|
+
total: number;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Generate points in the rectangular region
|
|
93
|
+
*/
|
|
94
|
+
protected _generatePoints(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Get the width of the region
|
|
97
|
+
*/
|
|
98
|
+
getWidth(): number;
|
|
99
|
+
/**
|
|
100
|
+
* Get the height of the region
|
|
101
|
+
*/
|
|
102
|
+
getHeight(): number;
|
|
103
|
+
/**
|
|
104
|
+
* Set the width and regenerate
|
|
105
|
+
* @param width - New width
|
|
106
|
+
* @returns this for chaining
|
|
107
|
+
*/
|
|
108
|
+
setWidth(width: number): this;
|
|
109
|
+
/**
|
|
110
|
+
* Set the height and regenerate
|
|
111
|
+
* @param height - New height
|
|
112
|
+
* @returns this for chaining
|
|
113
|
+
*/
|
|
114
|
+
setHeight(height: number): this;
|
|
115
|
+
/**
|
|
116
|
+
* Set both dimensions and regenerate
|
|
117
|
+
* @param width - New width
|
|
118
|
+
* @param height - New height
|
|
119
|
+
* @returns this for chaining
|
|
120
|
+
*/
|
|
121
|
+
setDimensions(width: number, height: number): this;
|
|
122
|
+
/**
|
|
123
|
+
* Set point counts for grid distribution (clears density)
|
|
124
|
+
* @param xCount - Points along width
|
|
125
|
+
* @param yCount - Points along height
|
|
126
|
+
* @returns this for chaining
|
|
127
|
+
*/
|
|
128
|
+
setPointCounts(xCount: number, yCount: number): this;
|
|
129
|
+
/**
|
|
130
|
+
* Set the density and regenerate (overrides point counts)
|
|
131
|
+
* @param density - Points per unit length (grid) or per unit area (random)
|
|
132
|
+
* @returns this for chaining
|
|
133
|
+
*/
|
|
134
|
+
setDensity(density: number): this;
|
|
135
|
+
/**
|
|
136
|
+
* Set the distribution pattern and regenerate
|
|
137
|
+
* @param distribution - 'grid' or 'random'
|
|
138
|
+
* @returns this for chaining
|
|
139
|
+
*/
|
|
140
|
+
setDistribution(distribution: Distribution2D): this;
|
|
141
|
+
/**
|
|
142
|
+
* Get the distribution pattern
|
|
143
|
+
*/
|
|
144
|
+
getDistribution(): Distribution2D;
|
|
145
|
+
/**
|
|
146
|
+
* Get the center of the region
|
|
147
|
+
*/
|
|
148
|
+
getCenter(): Vector3Tuple;
|
|
149
|
+
/**
|
|
150
|
+
* Move the region to center at a new position
|
|
151
|
+
* @param point - Target center position [x, y, z]
|
|
152
|
+
*/
|
|
153
|
+
moveTo(point: Vector3Tuple): this;
|
|
154
|
+
/**
|
|
155
|
+
* Shift the region by a delta
|
|
156
|
+
* @param delta - Translation vector [x, y, z]
|
|
157
|
+
* @returns this for chaining
|
|
158
|
+
*/
|
|
159
|
+
shift(delta: Vector3Tuple): this;
|
|
160
|
+
/**
|
|
161
|
+
* Regenerate the points (useful for random distribution refresh)
|
|
162
|
+
* @returns this for chaining
|
|
163
|
+
*/
|
|
164
|
+
regenerate(): this;
|
|
165
|
+
/**
|
|
166
|
+
* Create a copy of this Mobject2D
|
|
167
|
+
*/
|
|
168
|
+
protected _createCopy(): Mobject2D;
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=Mobject2D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mobject2D.d.ts","sourceRoot":"","sources":["../../../src/mobjects/point/Mobject2D.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM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IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAM/B;;;;;OAKG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAOlD;;;;;OAKG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAQpD;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMjC;;;;OAIG;IACH,eAAe,CAAC,YAAY,EAAE,cAAc,GAAG,IAAI;IAMnD;;OAEG;IACH,eAAe,IAAI,cAAc;IAIjC;;OAEG;IACM,SAAS,IAAI,YAAY;IAIlC;;;OAGG;IACM,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAW1C;;;;OAIG;IACM,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAoBzC;;;OAGG;IACH,UAAU,IAAI,IAAI;IAKlB;;OAEG;cACgB,WAAW,IAAI,SAAS;CAc5C"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Mobject, Vector3Tuple } from '../../core/Mobject';
|
|
2
|
+
import { PMobject } from './PMobject';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
/**
|
|
5
|
+
* Options for creating a PGroup
|
|
6
|
+
*/
|
|
7
|
+
export interface PGroupOptions {
|
|
8
|
+
/** Initial PMobjects to add */
|
|
9
|
+
pmobjects?: PMobject[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* PGroup - Group of PMobjects
|
|
13
|
+
*
|
|
14
|
+
* Similar to Group but specifically for PMobjects. Operations
|
|
15
|
+
* applied to the group cascade to all children.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const p1 = new PMobject({ points: [{ position: [0, 0, 0] }] });
|
|
20
|
+
* const p2 = new PMobject({ points: [{ position: [1, 1, 0] }] });
|
|
21
|
+
* const group = new PGroup({ pmobjects: [p1, p2] });
|
|
22
|
+
*
|
|
23
|
+
* // Move all PMobjects
|
|
24
|
+
* group.shift([1, 0, 0]);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class PGroup extends Mobject {
|
|
28
|
+
constructor(options?: PGroupOptions);
|
|
29
|
+
/**
|
|
30
|
+
* Add a PMobject to this group
|
|
31
|
+
* @param pmobject - PMobject to add
|
|
32
|
+
* @returns this for chaining
|
|
33
|
+
*/
|
|
34
|
+
addPMobject(pmobject: PMobject): this;
|
|
35
|
+
/**
|
|
36
|
+
* Add multiple PMobjects to this group
|
|
37
|
+
* @param pmobjects - PMobjects to add
|
|
38
|
+
* @returns this for chaining
|
|
39
|
+
*/
|
|
40
|
+
addPMobjects(...pmobjects: PMobject[]): this;
|
|
41
|
+
/**
|
|
42
|
+
* Remove a PMobject from this group
|
|
43
|
+
* @param pmobject - PMobject to remove
|
|
44
|
+
* @returns this for chaining
|
|
45
|
+
*/
|
|
46
|
+
removePMobject(pmobject: PMobject): this;
|
|
47
|
+
/**
|
|
48
|
+
* Get the center of the group
|
|
49
|
+
* @returns Center position as [x, y, z]
|
|
50
|
+
*/
|
|
51
|
+
getCenter(): Vector3Tuple;
|
|
52
|
+
/**
|
|
53
|
+
* Shift all children by the given delta
|
|
54
|
+
* @param delta - Translation vector [x, y, z]
|
|
55
|
+
* @returns this for chaining
|
|
56
|
+
*/
|
|
57
|
+
shift(delta: Vector3Tuple): this;
|
|
58
|
+
/**
|
|
59
|
+
* Move the group center to the given point
|
|
60
|
+
* @param point - Target position [x, y, z]
|
|
61
|
+
* @returns this for chaining
|
|
62
|
+
*/
|
|
63
|
+
moveTo(point: Vector3Tuple): this;
|
|
64
|
+
/**
|
|
65
|
+
* Set the color of all children
|
|
66
|
+
* @param color - CSS color string
|
|
67
|
+
* @returns this for chaining
|
|
68
|
+
*/
|
|
69
|
+
setColor(color: string): this;
|
|
70
|
+
/**
|
|
71
|
+
* Set the opacity of all children
|
|
72
|
+
* @param opacity - Opacity value (0-1)
|
|
73
|
+
* @returns this for chaining
|
|
74
|
+
*/
|
|
75
|
+
setOpacity(opacity: number): this;
|
|
76
|
+
/**
|
|
77
|
+
* Set the point size of all PMobject children
|
|
78
|
+
* @param size - Size in pixels
|
|
79
|
+
* @returns this for chaining
|
|
80
|
+
*/
|
|
81
|
+
setPointSize(size: number): this;
|
|
82
|
+
/**
|
|
83
|
+
* Arrange children in a row or column
|
|
84
|
+
* @param direction - Direction to arrange
|
|
85
|
+
* @param buff - Buffer between children
|
|
86
|
+
* @returns this for chaining
|
|
87
|
+
*/
|
|
88
|
+
arrange(direction?: Vector3Tuple, buff?: number): this;
|
|
89
|
+
/**
|
|
90
|
+
* Create the Three.js backing object
|
|
91
|
+
*/
|
|
92
|
+
protected _createThreeObject(): THREE.Object3D;
|
|
93
|
+
/**
|
|
94
|
+
* Create a copy of this PGroup
|
|
95
|
+
*/
|
|
96
|
+
protected _createCopy(): PGroup;
|
|
97
|
+
/**
|
|
98
|
+
* Get the number of PMobjects in this group
|
|
99
|
+
*/
|
|
100
|
+
get length(): number;
|
|
101
|
+
/**
|
|
102
|
+
* Get a PMobject by index
|
|
103
|
+
* @param index - Index of the PMobject
|
|
104
|
+
*/
|
|
105
|
+
get(index: number): PMobject | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Iterate over all PMobjects in the group
|
|
108
|
+
*/
|
|
109
|
+
[Symbol.iterator](): Iterator<PMobject>;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=PGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PGroup.d.ts","sourceRoot":"","sources":["../../../src/mobjects/point/PGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAS,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;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
+
/**
|
|
3
|
+
* Point-based mobjects rendered as particles using THREE.js Points.
|
|
4
|
+
* Unlike VMobjects which render connected paths, PMobjects render
|
|
5
|
+
* discrete points as particles for efficient visualization.
|
|
6
|
+
*/
|
|
7
|
+
import * as THREE from 'three';
|
|
8
|
+
/**
|
|
9
|
+
* A single point with position, color, and opacity.
|
|
10
|
+
*/
|
|
11
|
+
export interface PointData {
|
|
12
|
+
/** Position [x, y, z] */
|
|
13
|
+
position: Vector3Tuple;
|
|
14
|
+
/** Color as CSS color string */
|
|
15
|
+
color?: string;
|
|
16
|
+
/** Opacity from 0 to 1 */
|
|
17
|
+
opacity?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Options for creating a PMobject
|
|
21
|
+
*/
|
|
22
|
+
export interface PMobjectOptions {
|
|
23
|
+
/** Initial points to add */
|
|
24
|
+
points?: PointData[];
|
|
25
|
+
/** Default color for points. Default: white (#FFFFFF) */
|
|
26
|
+
color?: string;
|
|
27
|
+
/** Default opacity for points. Default: 1 */
|
|
28
|
+
opacity?: number;
|
|
29
|
+
/** Size of each point in pixels. Default: 10 */
|
|
30
|
+
pointSize?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* PMobject - Point-based mobject (not vector-based like VMobject)
|
|
34
|
+
*
|
|
35
|
+
* A collection of points rendered as particles using THREE.js Points
|
|
36
|
+
* and PointsMaterial. Each point has position, color, and opacity.
|
|
37
|
+
* Points are not connected like VMobject paths.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* // Create a PMobject with some points
|
|
42
|
+
* const points = new PMobject({
|
|
43
|
+
* points: [
|
|
44
|
+
* { position: [0, 0, 0] },
|
|
45
|
+
* { position: [1, 0, 0], color: '#ff0000' },
|
|
46
|
+
* { position: [0, 1, 0], color: '#00ff00', opacity: 0.5 },
|
|
47
|
+
* ],
|
|
48
|
+
* pointSize: 15,
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare class PMobject extends Mobject {
|
|
53
|
+
/** Internal point data storage */
|
|
54
|
+
protected _points: PointData[];
|
|
55
|
+
/** Point size in pixels */
|
|
56
|
+
protected _pointSize: number;
|
|
57
|
+
/** THREE.js geometry for points */
|
|
58
|
+
protected _geometry: THREE.BufferGeometry | null;
|
|
59
|
+
/** THREE.js material for points */
|
|
60
|
+
protected _material: THREE.PointsMaterial | null;
|
|
61
|
+
constructor(options?: PMobjectOptions);
|
|
62
|
+
/**
|
|
63
|
+
* Add a single point to the mobject
|
|
64
|
+
* @param point - Point data with position and optional color/opacity
|
|
65
|
+
* @returns this for chaining
|
|
66
|
+
*/
|
|
67
|
+
addPoint(point: PointData): this;
|
|
68
|
+
/**
|
|
69
|
+
* Add multiple points to the mobject
|
|
70
|
+
* @param points - Array of point data
|
|
71
|
+
* @returns this for chaining
|
|
72
|
+
*/
|
|
73
|
+
addPoints(points: PointData[]): this;
|
|
74
|
+
/**
|
|
75
|
+
* Remove a point by index
|
|
76
|
+
* @param index - Index of point to remove
|
|
77
|
+
* @returns this for chaining
|
|
78
|
+
*/
|
|
79
|
+
removePoint(index: number): this;
|
|
80
|
+
/**
|
|
81
|
+
* Clear all points
|
|
82
|
+
* @returns this for chaining
|
|
83
|
+
*/
|
|
84
|
+
clearPoints(): this;
|
|
85
|
+
/**
|
|
86
|
+
* Get all points
|
|
87
|
+
* @returns Copy of the points array
|
|
88
|
+
*/
|
|
89
|
+
getPoints(): PointData[];
|
|
90
|
+
/**
|
|
91
|
+
* Get the number of points
|
|
92
|
+
*/
|
|
93
|
+
get numPoints(): number;
|
|
94
|
+
/**
|
|
95
|
+
* Set the point size
|
|
96
|
+
* @param size - Size in pixels
|
|
97
|
+
* @returns this for chaining
|
|
98
|
+
*/
|
|
99
|
+
setPointSize(size: number): this;
|
|
100
|
+
/**
|
|
101
|
+
* Get the point size
|
|
102
|
+
*/
|
|
103
|
+
getPointSize(): number;
|
|
104
|
+
/**
|
|
105
|
+
* Set the color of all points
|
|
106
|
+
* @param color - CSS color string
|
|
107
|
+
* @returns this for chaining
|
|
108
|
+
*/
|
|
109
|
+
setColor(color: string): this;
|
|
110
|
+
/**
|
|
111
|
+
* Set the opacity of all points
|
|
112
|
+
* @param opacity - Opacity value (0-1)
|
|
113
|
+
* @returns this for chaining
|
|
114
|
+
*/
|
|
115
|
+
setOpacity(opacity: number): this;
|
|
116
|
+
/**
|
|
117
|
+
* Get the center of all points
|
|
118
|
+
* @returns Center position as [x, y, z]
|
|
119
|
+
*/
|
|
120
|
+
getCenter(): Vector3Tuple;
|
|
121
|
+
/**
|
|
122
|
+
* Shift all points by a delta
|
|
123
|
+
* @param delta - Translation vector [x, y, z]
|
|
124
|
+
* @returns this for chaining
|
|
125
|
+
*/
|
|
126
|
+
shift(delta: Vector3Tuple): this;
|
|
127
|
+
/**
|
|
128
|
+
* Create the Three.js backing object
|
|
129
|
+
*/
|
|
130
|
+
protected _createThreeObject(): THREE.Object3D;
|
|
131
|
+
/**
|
|
132
|
+
* Update or create the geometry from points
|
|
133
|
+
*/
|
|
134
|
+
protected _updateGeometry(): void;
|
|
135
|
+
/**
|
|
136
|
+
* Update or create the material
|
|
137
|
+
*/
|
|
138
|
+
protected _updateMaterial(): void;
|
|
139
|
+
/**
|
|
140
|
+
* Sync material properties to Three.js
|
|
141
|
+
*/
|
|
142
|
+
protected _syncMaterialToThree(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Create a copy of this PMobject
|
|
145
|
+
*/
|
|
146
|
+
protected _createCopy(): PMobject;
|
|
147
|
+
/**
|
|
148
|
+
* Clean up Three.js resources
|
|
149
|
+
*/
|
|
150
|
+
dispose(): void;
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=PMobject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PMobject.d.ts","sourceRoot":"","sources":["../../../src/mobjects/point/PMobject.ts"],"names":[],"mappings":"AAAA;;;;GAIG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SAAS,IAAI,MAAM,CAEtB;IAED;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAMhC;;OAEG;IACH,YAAY,IAAI,MAAM;IAItB;;;;OAIG;IACM,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQtC;;;;OAIG;IACM,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAQ1C;;;OAGG;IACM,SAAS,IAAI,YAAY;IAsBlC;;;;OAIG;IACM,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAUzC;;OAEG;cACgB,kBAAkB,IAAI,KAAK,CAAC,QAAQ;IAQvD;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,IAAI;IAsBjC;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,IAAI;IAgBjC;;OAEG;cACgB,oBAAoB,IAAI,IAAI;IAU/C;;OAEG;cACgB,WAAW,IAAI,QAAQ;IAS1C;;OAEG;IACM,OAAO,IAAI,IAAI;CAKzB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Vector3Tuple } from '../../core/Mobject';
|
|
2
|
+
import { PMobject } from './PMobject';
|
|
3
|
+
/**
|
|
4
|
+
* Options for creating a PointCloudDot
|
|
5
|
+
*/
|
|
6
|
+
export interface PointCloudDotOptions {
|
|
7
|
+
/** Center position [x, y, z]. Default: [0, 0, 0] */
|
|
8
|
+
center?: Vector3Tuple;
|
|
9
|
+
/** Radius of the dot. Default: 0.08 */
|
|
10
|
+
radius?: number;
|
|
11
|
+
/** Number of particles. Default: 50 */
|
|
12
|
+
numParticles?: number;
|
|
13
|
+
/** Color as CSS color string. Default: white (#FFFFFF) */
|
|
14
|
+
color?: string;
|
|
15
|
+
/** Opacity from 0 to 1. Default: 1 */
|
|
16
|
+
opacity?: number;
|
|
17
|
+
/** Size of each particle in pixels. Default: 4 */
|
|
18
|
+
particleSize?: number;
|
|
19
|
+
/** Spread pattern: 'uniform' for even distribution, 'gaussian' for center-heavy. Default: 'gaussian' */
|
|
20
|
+
distribution?: 'uniform' | 'gaussian';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* PointCloudDot - Dot rendered as multiple particles
|
|
24
|
+
*
|
|
25
|
+
* Creates a "fuzzy" dot effect by rendering multiple particles
|
|
26
|
+
* within a radius. The particles create a soft, glowing appearance.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* // Create a fuzzy dot at the origin
|
|
31
|
+
* const dot = new PointCloudDot();
|
|
32
|
+
*
|
|
33
|
+
* // Create a large, dense fuzzy dot
|
|
34
|
+
* const bigDot = new PointCloudDot({
|
|
35
|
+
* center: [1, 0, 0],
|
|
36
|
+
* radius: 0.2,
|
|
37
|
+
* numParticles: 100,
|
|
38
|
+
* color: '#ff6600',
|
|
39
|
+
* distribution: 'gaussian',
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare class PointCloudDot extends PMobject {
|
|
44
|
+
protected _center: Vector3Tuple;
|
|
45
|
+
protected _radius: number;
|
|
46
|
+
protected _numParticles: number;
|
|
47
|
+
protected _distribution: 'uniform' | 'gaussian';
|
|
48
|
+
constructor(options?: PointCloudDotOptions);
|
|
49
|
+
/**
|
|
50
|
+
* Generate particles within the radius
|
|
51
|
+
*/
|
|
52
|
+
protected _generateParticles(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Get the center of the dot
|
|
55
|
+
*/
|
|
56
|
+
getCenter(): Vector3Tuple;
|
|
57
|
+
/**
|
|
58
|
+
* Move the dot to a new position
|
|
59
|
+
* @param point - Target position [x, y, z]
|
|
60
|
+
*/
|
|
61
|
+
moveTo(point: Vector3Tuple): this;
|
|
62
|
+
/**
|
|
63
|
+
* Get the radius of the dot
|
|
64
|
+
*/
|
|
65
|
+
getRadius(): number;
|
|
66
|
+
/**
|
|
67
|
+
* Set the radius and regenerate particles
|
|
68
|
+
* @param radius - New radius
|
|
69
|
+
* @returns this for chaining
|
|
70
|
+
*/
|
|
71
|
+
setRadius(radius: number): this;
|
|
72
|
+
/**
|
|
73
|
+
* Get the number of particles
|
|
74
|
+
*/
|
|
75
|
+
getNumParticles(): number;
|
|
76
|
+
/**
|
|
77
|
+
* Set the number of particles and regenerate
|
|
78
|
+
* @param count - New particle count
|
|
79
|
+
* @returns this for chaining
|
|
80
|
+
*/
|
|
81
|
+
setNumParticles(count: number): this;
|
|
82
|
+
/**
|
|
83
|
+
* Set the distribution pattern and regenerate
|
|
84
|
+
* @param distribution - 'uniform' or 'gaussian'
|
|
85
|
+
* @returns this for chaining
|
|
86
|
+
*/
|
|
87
|
+
setDistribution(distribution: 'uniform' | 'gaussian'): this;
|
|
88
|
+
/**
|
|
89
|
+
* Regenerate the particles (useful after changing properties)
|
|
90
|
+
* @returns this for chaining
|
|
91
|
+
*/
|
|
92
|
+
regenerate(): this;
|
|
93
|
+
/**
|
|
94
|
+
* Create a copy of this PointCloudDot
|
|
95
|
+
*/
|
|
96
|
+
protected _createCopy(): PointCloudDot;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=PointCloudDot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointCloudDot.d.ts","sourceRoot":"","sources":["../../../src/mobjects/point/PointCloudDot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wGAAwG;IACxG,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,aAAc,SAAQ,QAAQ;IACzC,SAAS,CAAC,OAAO,EAAE,YAAY,CAAC;IAChC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;IAChC,SAAS,CAAC,aAAa,EAAE,SAAS,GAAG,UAAU,CAAC;gBAEpC,OAAO,GAAE,oBAAyB;IAyB9C;;OAEG;IACH,SAAS,CAAC,kBAAkB,IAAI,IAAI;IA2CpC;;OAEG;IACM,SAAS,IAAI,YAAY;IAIlC;;;OAGG;IACM,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAU1C;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAM/B;;OAEG;IACH,eAAe,IAAI,MAAM;IAIzB;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMpC;;;;OAIG;IACH,eAAe,CAAC,YAAY,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI;IAM3D;;;OAGG;IACH,UAAU,IAAI,IAAI;IAKlB;;OAEG;cACgB,WAAW,IAAI,aAAa;CAWhD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Vector3Tuple } from '../../core/Mobject';
|
|
2
|
+
import { PMobject } from './PMobject';
|
|
3
|
+
/**
|
|
4
|
+
* Options for creating a PointMobject
|
|
5
|
+
*/
|
|
6
|
+
export interface PointMobjectOptions {
|
|
7
|
+
/** Position [x, y, z]. Default: [0, 0, 0] */
|
|
8
|
+
position?: Vector3Tuple;
|
|
9
|
+
/** Color as CSS color string. Default: white (#FFFFFF) */
|
|
10
|
+
color?: string;
|
|
11
|
+
/** Opacity from 0 to 1. Default: 1 */
|
|
12
|
+
opacity?: number;
|
|
13
|
+
/** Size in pixels. Default: 8 */
|
|
14
|
+
size?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* PointMobject - Single point mobject
|
|
18
|
+
*
|
|
19
|
+
* Renders as a single dot/particle. Lightweight, no stroke.
|
|
20
|
+
* Uses THREE.js Points for efficient rendering.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Create a point at the origin
|
|
25
|
+
* const point = new PointMobject();
|
|
26
|
+
*
|
|
27
|
+
* // Create a red point at a specific position
|
|
28
|
+
* const redPoint = new PointMobject({
|
|
29
|
+
* position: [1, 2, 0],
|
|
30
|
+
* color: '#ff0000',
|
|
31
|
+
* size: 12,
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare class PointMobject extends PMobject {
|
|
36
|
+
constructor(options?: PointMobjectOptions);
|
|
37
|
+
/**
|
|
38
|
+
* Get the position of the point
|
|
39
|
+
* @returns Position as [x, y, z]
|
|
40
|
+
*/
|
|
41
|
+
getPosition(): Vector3Tuple;
|
|
42
|
+
/**
|
|
43
|
+
* Set the position of the point
|
|
44
|
+
* @param position - New position [x, y, z]
|
|
45
|
+
* @returns this for chaining
|
|
46
|
+
*/
|
|
47
|
+
setPosition(position: Vector3Tuple): this;
|
|
48
|
+
/**
|
|
49
|
+
* Get the center (same as position for a single point)
|
|
50
|
+
*/
|
|
51
|
+
getCenter(): Vector3Tuple;
|
|
52
|
+
/**
|
|
53
|
+
* Move the point to a new position
|
|
54
|
+
* @param point - Target position [x, y, z]
|
|
55
|
+
*/
|
|
56
|
+
moveTo(point: Vector3Tuple): this;
|
|
57
|
+
/**
|
|
58
|
+
* Create a copy of this PointMobject
|
|
59
|
+
*/
|
|
60
|
+
protected _createCopy(): PointMobject;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=PointMobject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointMobject.d.ts","sourceRoot":"","sources":["../../../src/mobjects/point/PointMobject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,YAAa,SAAQ,QAAQ;gBAC5B,OAAO,GAAE,mBAAwB;IAW7C;;;OAGG;IACH,WAAW,IAAI,YAAY;IAO3B;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAQzC;;OAEG;IACM,SAAS,IAAI,YAAY;IAIlC;;;OAGG;IACM,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAI1C;;OAEG;cACgB,WAAW,IAAI,YAAY;CAQ/C"}
|