manim-web 0.3.24 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/GLTFLoader-CisHz7tR.js +1381 -0
- package/dist/GLTFLoader-DMbWuMln.js +1381 -0
- package/dist/{MathJaxBundle-xSidSV0E.js → MathJaxBundle-BSrlS0Dh.js} +3338 -3320
- package/dist/OBJLoader-Clh2POv9.js +287 -0
- package/dist/OBJLoader-kkTsEhJf.js +287 -0
- package/dist/animation/Always.d.ts +72 -0
- package/dist/animation/Always.d.ts.map +1 -0
- package/dist/animation/AlwaysRedraw.d.ts +15 -0
- package/dist/animation/AlwaysRedraw.d.ts.map +1 -0
- package/dist/animation/Animation.d.ts +9 -0
- package/dist/animation/Animation.d.ts.map +1 -1
- package/dist/animation/AnimationUtilities.d.ts +25 -0
- package/dist/animation/AnimationUtilities.d.ts.map +1 -1
- package/dist/animation/creation/Create.d.ts +40 -11
- package/dist/animation/creation/Create.d.ts.map +1 -1
- package/dist/animation/transform/PointMorphStrategy.d.ts +6 -0
- package/dist/animation/transform/PointMorphStrategy.d.ts.map +1 -1
- package/dist/animation/transform/Transform.d.ts.map +1 -1
- package/dist/animation/transform/TransformPairing.d.ts +17 -0
- package/dist/animation/transform/TransformPairing.d.ts.map +1 -1
- package/dist/animation/updaters.d.ts +69 -0
- package/dist/animation/updaters.d.ts.map +1 -0
- package/dist/compiler-CfW6eH2M.js +2 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/parity.d.ts +78 -0
- package/dist/constants/parity.d.ts.map +1 -0
- package/dist/core/Mobject.d.ts +48 -3
- package/dist/core/Mobject.d.ts.map +1 -1
- package/dist/core/MobjectTraversal.d.ts +7 -0
- package/dist/core/MobjectTraversal.d.ts.map +1 -1
- package/dist/core/MobjectTypes.d.ts +15 -0
- package/dist/core/MobjectTypes.d.ts.map +1 -1
- package/dist/core/Scene.d.ts +14 -0
- package/dist/core/Scene.d.ts.map +1 -1
- package/dist/core/SpecialThreeDScene.d.ts +64 -0
- package/dist/core/SpecialThreeDScene.d.ts.map +1 -0
- package/dist/core/VMobject.d.ts +143 -0
- package/dist/core/VMobject.d.ts.map +1 -1
- package/dist/core/VMobjectColorGradient.d.ts +20 -0
- package/dist/core/VMobjectColorGradient.d.ts.map +1 -0
- package/dist/core/VMobjectCurveMath.d.ts +128 -0
- package/dist/core/VMobjectCurveMath.d.ts.map +1 -0
- package/dist/core/VMobjectRendering.d.ts +38 -1
- package/dist/core/VMobjectRendering.d.ts.map +1 -1
- package/dist/core/VMobjectRoundCorners.d.ts +37 -0
- package/dist/core/VMobjectRoundCorners.d.ts.map +1 -0
- package/dist/esm-CiMKSfxz.js +1273 -0
- package/dist/export/FrameExporter.d.ts +86 -0
- package/dist/export/FrameExporter.d.ts.map +1 -0
- package/dist/export/GifExporter.d.ts +4 -0
- package/dist/export/GifExporter.d.ts.map +1 -1
- package/dist/export/WebCodecsExporter.d.ts +108 -0
- package/dist/export/WebCodecsExporter.d.ts.map +1 -0
- package/dist/export/index.d.ts +2 -0
- package/dist/export/index.d.ts.map +1 -1
- package/dist/global-compiler-D_nF-JaV.js +8 -0
- package/dist/global-renderer-gyshX_QF.js +8 -0
- package/dist/index.d.ts +29 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/integrations/react.js +17 -16
- package/dist/integrations/vue.js +16 -15
- package/dist/integrations/webcomponent.d.ts +65 -0
- package/dist/integrations/webcomponent.d.ts.map +1 -0
- package/dist/integrations/webcomponent.js +2 -0
- package/dist/manim-web.browser.js +36877 -45066
- package/dist/mobjects/geometry/AngleShapes.d.ts.map +1 -1
- package/dist/mobjects/geometry/ArcPolygon.d.ts +30 -0
- package/dist/mobjects/geometry/ArcPolygon.d.ts.map +1 -1
- package/dist/mobjects/geometry/DashedLine.d.ts.map +1 -1
- package/dist/mobjects/geometry/Label.d.ts +32 -0
- package/dist/mobjects/geometry/Label.d.ts.map +1 -0
- package/dist/mobjects/geometry/index.d.ts +2 -1
- package/dist/mobjects/geometry/index.d.ts.map +1 -1
- package/dist/mobjects/graphing/Axes.d.ts +73 -6
- package/dist/mobjects/graphing/Axes.d.ts.map +1 -1
- package/dist/mobjects/graphing/CoordinateSystem.d.ts +40 -0
- package/dist/mobjects/graphing/CoordinateSystem.d.ts.map +1 -0
- package/dist/mobjects/graphing/axes-calculus.d.ts +79 -0
- package/dist/mobjects/graphing/axes-calculus.d.ts.map +1 -0
- package/dist/mobjects/graphing/index.d.ts +3 -0
- package/dist/mobjects/graphing/index.d.ts.map +1 -1
- package/dist/mobjects/graphing/scale.d.ts +72 -0
- package/dist/mobjects/graphing/scale.d.ts.map +1 -0
- package/dist/mobjects/text/MathJaxRenderer.d.ts +5 -0
- package/dist/mobjects/text/MathJaxRenderer.d.ts.map +1 -1
- package/dist/mobjects/text/MathTex.d.ts +23 -0
- package/dist/mobjects/text/MathTex.d.ts.map +1 -1
- package/dist/mobjects/text/MathTexImage.d.ts.map +1 -1
- package/dist/mobjects/text/Text.d.ts +53 -0
- package/dist/mobjects/text/Text.d.ts.map +1 -1
- package/dist/mobjects/text/Typst.d.ts +113 -0
- package/dist/mobjects/text/Typst.d.ts.map +1 -0
- package/dist/mobjects/text/TypstRenderer.d.ts +57 -0
- package/dist/mobjects/text/TypstRenderer.d.ts.map +1 -0
- package/dist/mobjects/text/index.d.ts +5 -2
- package/dist/mobjects/text/index.d.ts.map +1 -1
- package/dist/mobjects/text/katexStyles.d.ts +5 -0
- package/dist/mobjects/text/katexStyles.d.ts.map +1 -1
- package/dist/mobjects/text/registerFont.d.ts +38 -0
- package/dist/mobjects/text/registerFont.d.ts.map +1 -0
- package/dist/mobjects/text/textStyleRuns.d.ts +111 -0
- package/dist/mobjects/text/textStyleRuns.d.ts.map +1 -0
- package/dist/mobjects/three-d/ModelMobject.d.ts +122 -0
- package/dist/mobjects/three-d/ModelMobject.d.ts.map +1 -0
- package/dist/mobjects/three-d/ThreeDAxes.d.ts +37 -4
- package/dist/mobjects/three-d/ThreeDAxes.d.ts.map +1 -1
- package/dist/mobjects/three-d/threeDVmobUtils.d.ts +25 -0
- package/dist/mobjects/three-d/threeDVmobUtils.d.ts.map +1 -0
- package/dist/mobjects/video/VideoMobject.d.ts +126 -0
- package/dist/mobjects/video/VideoMobject.d.ts.map +1 -0
- package/dist/mobjects/video/index.d.ts +2 -0
- package/dist/mobjects/video/index.d.ts.map +1 -0
- package/dist/mp4-muxer-5DGKGEJk.js +900 -0
- package/dist/player/Player.d.ts +4 -0
- package/dist/player/Player.d.ts.map +1 -1
- package/dist/renderer-DR_79fB0.js +2 -0
- package/dist/{src-Cc3xTIkV.js → src-C817VR8M.js} +10693 -7971
- package/dist/three.core-1aHSpGwp.js +11626 -0
- package/dist/utils/ManimColor.d.ts +163 -0
- package/dist/utils/ManimColor.d.ts.map +1 -0
- package/dist/utils/bezier.d.ts +95 -0
- package/dist/utils/bezier.d.ts.map +1 -0
- package/dist/utils/color.d.ts +99 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/debug.d.ts +36 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/iterables.d.ts +162 -0
- package/dist/utils/iterables.d.ts.map +1 -0
- package/dist/utils/paths.d.ts +38 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/simpleFunctions.d.ts +26 -0
- package/dist/utils/simpleFunctions.d.ts.map +1 -0
- package/dist/utils/spaceOps.d.ts +119 -0
- package/dist/utils/spaceOps.d.ts.map +1 -0
- package/dist/utils/unit.d.ts +28 -0
- package/dist/utils/unit.d.ts.map +1 -0
- package/dist/wasm-CIlzm7By.js +76 -0
- package/dist/wasm-pack-shim-B3C4KoWa.js +1688 -0
- package/dist/wasm-pack-shim-BgTFpSvJ.js +911 -0
- package/dist/webcomponent-BS5WnkDO.js +707 -0
- package/dist/webm-muxer-BGY-Mgbp.js +857 -0
- package/package.json +19 -8
package/dist/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
import { ThreeDScene, ThreeDSceneOptions } from './ThreeDScene';
|
|
2
|
+
import { ThreeDAxes, ThreeDAxesOptions } from '../mobjects/three-d/ThreeDAxes';
|
|
3
|
+
import { Sphere, SphereOptions } from '../mobjects/three-d/Sphere';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for {@link SpecialThreeDScene}, extending the base 3D scene
|
|
6
|
+
* options with CE's extra axes, sphere, and default-camera settings.
|
|
7
|
+
*/
|
|
8
|
+
export interface SpecialThreeDSceneOptions extends ThreeDSceneOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Whether `getAxes()` cuts each axis at radius 1. CE builds the axis from
|
|
11
|
+
* three line pieces to do this; this port's `ThreeDAxes` renders a single
|
|
12
|
+
* continuous axis with no piece sub-structure, so the flag is stored but not
|
|
13
|
+
* applied. Defaults to true.
|
|
14
|
+
*/
|
|
15
|
+
cutAxesAtRadius?: boolean;
|
|
16
|
+
/** Overrides merged over {@link getDefaultAxesConfig} when building axes. */
|
|
17
|
+
threeDAxesConfig?: ThreeDAxesOptions;
|
|
18
|
+
/** Overrides merged over {@link getDefaultSphereConfig} when building spheres. */
|
|
19
|
+
sphereConfig?: SphereOptions;
|
|
20
|
+
/** The default angled camera position, in radians. */
|
|
21
|
+
defaultAngledCameraPosition?: {
|
|
22
|
+
phi: number;
|
|
23
|
+
theta: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* An extension of {@link ThreeDScene} with CE's `SpecialThreeDScene` defaults:
|
|
28
|
+
* a higher-resolution sphere, a tick-marked axes config, and a default angled
|
|
29
|
+
* camera position.
|
|
30
|
+
*
|
|
31
|
+
* CE config keys with no equivalent in this port are omitted:
|
|
32
|
+
* - `camera_config` (`should_apply_shading`, `exponential_projection`): this
|
|
33
|
+
* port's camera has no per-scene shading or projection toggles.
|
|
34
|
+
* - `three_d_axes_config` keys `num_axis_pieces`, `unit_size`,
|
|
35
|
+
* `numbers_with_elongated_ticks`, `stroke_width`: not exposed by
|
|
36
|
+
* {@link ThreeDAxesOptions}.
|
|
37
|
+
* - `low_quality_config`: this port has no low-quality render path to override.
|
|
38
|
+
*/
|
|
39
|
+
export declare class SpecialThreeDScene extends ThreeDScene {
|
|
40
|
+
readonly cutAxesAtRadius: boolean;
|
|
41
|
+
private readonly _threeDAxesConfig;
|
|
42
|
+
private readonly _sphereConfig;
|
|
43
|
+
private readonly _defaultAngledCameraPosition;
|
|
44
|
+
constructor(container: HTMLElement | null, options?: SpecialThreeDSceneOptions);
|
|
45
|
+
/**
|
|
46
|
+
* The default axes config. CE's `tick_frequency: 1` maps to a range step of
|
|
47
|
+
* 1; the range is symmetric with ticks shown.
|
|
48
|
+
*/
|
|
49
|
+
getDefaultAxesConfig(): ThreeDAxesOptions;
|
|
50
|
+
/** The default sphere config: CE's radius 2 at the collapsed resolution. */
|
|
51
|
+
getDefaultSphereConfig(): SphereOptions;
|
|
52
|
+
/** Build a set of 3D axes from the default axes config and any overrides. */
|
|
53
|
+
getAxes(): ThreeDAxes;
|
|
54
|
+
/** Build a sphere from the default sphere config and any overrides. */
|
|
55
|
+
getSphere(overrides?: SphereOptions): Sphere;
|
|
56
|
+
/** The default angled camera position, in radians. */
|
|
57
|
+
getDefaultCameraPosition(): {
|
|
58
|
+
phi: number;
|
|
59
|
+
theta: number;
|
|
60
|
+
};
|
|
61
|
+
/** Set the camera to its default angled position. */
|
|
62
|
+
setCameraToDefaultPosition(): this;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=SpecialThreeDScene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpecialThreeDScene.d.ts","sourceRoot":"","sources":["../../src/core/SpecialThreeDScene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAqBxE;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACnE;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,kFAAkF;IAClF,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,sDAAsD;IACtD,2BAA2B,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IACtD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAiC;gBAElE,SAAS,EAAE,WAAW,GAAG,IAAI,EAAE,OAAO,GAAE,yBAA8B;IAmBlF;;;OAGG;IACH,oBAAoB,IAAI,iBAAiB;IASzC,4EAA4E;IAC5E,sBAAsB,IAAI,aAAa;IAOvC,6EAA6E;IAC7E,OAAO,IAAI,UAAU;IAIrB,uEAAuE;IACvE,SAAS,CAAC,SAAS,GAAE,aAAkB,GAAG,MAAM;IAIhD,sDAAsD;IACtD,wBAAwB,IAAI;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IAI1D,qDAAqD;IACrD,0BAA0B,IAAI,IAAI;CAInC"}
|
package/dist/core/VMobject.d.ts
CHANGED
|
@@ -54,6 +54,25 @@ export declare class VMobject extends VMobjectRendering {
|
|
|
54
54
|
* @post result[i] === _points3D[i]
|
|
55
55
|
*/
|
|
56
56
|
getLocalPoints(): number[][];
|
|
57
|
+
/**
|
|
58
|
+
* Whether this exact node owns drawable geometry (its raw `_points3D`),
|
|
59
|
+
* bypassing any subclass override of `getLocalPoints()`. VGroup (and every
|
|
60
|
+
* class extending it — MathTex, SVGMobject, Arrow, Table, ...) overrides
|
|
61
|
+
* `getLocalPoints()` to aggregate its children's points for read-modify-write
|
|
62
|
+
* transforms (Homotopy, ApplyWave, ...); that aggregation must NOT make the
|
|
63
|
+
* container itself look like a stagger unit with points of its own.
|
|
64
|
+
*/
|
|
65
|
+
protected _hasOwnPoints(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Public counterpart to {@link _hasOwnPoints}. Lets code outside the
|
|
68
|
+
* VMobject hierarchy (Transform's strategy selection, leaf-snapshot
|
|
69
|
+
* traversal) distinguish "this node carries its own geometry" from
|
|
70
|
+
* "this node delegates entirely to VMobject children" — true not just
|
|
71
|
+
* for VGroup, but for any VMobject subclass that clears its own points
|
|
72
|
+
* and renders via children (DashedLine, a multi-component
|
|
73
|
+
* RegularPolygram, ...).
|
|
74
|
+
*/
|
|
75
|
+
hasOwnPoints(): boolean;
|
|
57
76
|
/**
|
|
58
77
|
* Own points in world coordinates (full ancestor S/R/T chain; render-only
|
|
59
78
|
* z-layering offset excluded). Children's points are not included — use
|
|
@@ -72,6 +91,15 @@ export declare class VMobject extends VMobjectRendering {
|
|
|
72
91
|
* @post result === flatMap(this + vmobjectDescendants, m => m.getPoints())
|
|
73
92
|
*/
|
|
74
93
|
getAllPoints(): number[][];
|
|
94
|
+
/**
|
|
95
|
+
* Family members (including self) that own points directly — Manim CE's
|
|
96
|
+
* `family_members_with_points()`. This is the unit that staggered animations
|
|
97
|
+
* (e.g. Create's lagRatio) should iterate over: a VMobject with several
|
|
98
|
+
* internal subpaths is still ONE entry here, never split per subpath.
|
|
99
|
+
*
|
|
100
|
+
* @post result === this.getFamily().filter(m => m instanceof VMobject && m._hasOwnPoints())
|
|
101
|
+
*/
|
|
102
|
+
familyMembersWithPoints(): VMobject[];
|
|
75
103
|
/**
|
|
76
104
|
* @pre fn(pts).length === pts.length
|
|
77
105
|
* @post getPoints()[i] === fn(old.getPoints().map(p => p - aboutPoint))[i] + aboutPoint
|
|
@@ -126,6 +154,34 @@ export declare class VMobject extends VMobjectRendering {
|
|
|
126
154
|
* @returns this for chaining
|
|
127
155
|
*/
|
|
128
156
|
addPointsAsCorners(corners: number[][]): this;
|
|
157
|
+
/**
|
|
158
|
+
* Append a shared-anchor cubic chain to this VMobject's points (Manim CE's
|
|
159
|
+
* `append_points`). When this path is non-empty the first appended anchor
|
|
160
|
+
* continues from the last existing anchor and is dropped, so the chain stays
|
|
161
|
+
* one continuous path with the 3k+1-point invariant. Chainable.
|
|
162
|
+
*
|
|
163
|
+
* @param points - Points to append (a shared-anchor chain on its own)
|
|
164
|
+
* @returns this for chaining
|
|
165
|
+
*/
|
|
166
|
+
appendPoints(points: number[][]): this;
|
|
167
|
+
/**
|
|
168
|
+
* Subdivide this path so it contains `n` more cubic curves without changing
|
|
169
|
+
* its shape (Manim CE's `insert_n_curves`). Chainable.
|
|
170
|
+
*
|
|
171
|
+
* @param n - Number of cubics to add
|
|
172
|
+
* @returns this for chaining
|
|
173
|
+
*/
|
|
174
|
+
insertNCurves(n: number): this;
|
|
175
|
+
/**
|
|
176
|
+
* Pure counterpart of {@link insertNCurves}: return a copy of `points` with
|
|
177
|
+
* `n` more cubics (Manim CE's `insert_n_curves_to_point_list`). Does not
|
|
178
|
+
* mutate this VMobject.
|
|
179
|
+
*
|
|
180
|
+
* @param n - Number of cubics to add
|
|
181
|
+
* @param points - Source shared-anchor cubic chain
|
|
182
|
+
* @returns New chain with `n` more cubics
|
|
183
|
+
*/
|
|
184
|
+
insertNCurvesToPointList(n: number, points: number[][]): number[][];
|
|
129
185
|
/**
|
|
130
186
|
* Clear all points
|
|
131
187
|
*/
|
|
@@ -282,6 +338,93 @@ export declare class VMobject extends VMobjectRendering {
|
|
|
282
338
|
* @returns this for chaining
|
|
283
339
|
*/
|
|
284
340
|
centerPointsAroundPosition(): this;
|
|
341
|
+
/**
|
|
342
|
+
* Point at arc-length proportion `alpha` along this VMobject's curve.
|
|
343
|
+
*
|
|
344
|
+
* `alpha` is measured by cumulative arc length over all cubic segments, so
|
|
345
|
+
* `getPointFromProportion(0.5)` is the geometric midpoint of the whole path
|
|
346
|
+
* (not the midpoint of the middle segment). Matches Manim CE's
|
|
347
|
+
* `point_from_proportion`. Points are in this object's local space.
|
|
348
|
+
*
|
|
349
|
+
* @param alpha - Proportion in [0, 1]
|
|
350
|
+
* @returns Point as [x, y, z]
|
|
351
|
+
* @throws Error when the VMobject has no points
|
|
352
|
+
*/
|
|
353
|
+
getPointFromProportion(alpha: number): Vector3Tuple;
|
|
354
|
+
/**
|
|
355
|
+
* Arc-length proportion of the point on this curve nearest to `point`.
|
|
356
|
+
*
|
|
357
|
+
* Monotone inverse of {@link getPointFromProportion}: for a point that lies
|
|
358
|
+
* on the curve it round-trips back to the same point at sampling resolution.
|
|
359
|
+
*
|
|
360
|
+
* @param point - Query point [x, y, z] in local space
|
|
361
|
+
* @returns Proportion in [0, 1]
|
|
362
|
+
*/
|
|
363
|
+
proportionFromPoint(point: Vector3Tuple): number;
|
|
364
|
+
/**
|
|
365
|
+
* Replace this VMobject's points with the partial path of `vmobject`
|
|
366
|
+
* between arc-index proportions a and b. Port of Manim CE's
|
|
367
|
+
* `pointwise_become_partial`. Backs ShowPassingFlash on arbitrary VMobjects.
|
|
368
|
+
*
|
|
369
|
+
* @param vmobject - Source VMobject to take the partial path from
|
|
370
|
+
* @param a - Start proportion in [0, 1]
|
|
371
|
+
* @param b - End proportion in [0, 1]
|
|
372
|
+
* @returns this for chaining
|
|
373
|
+
*/
|
|
374
|
+
pointwiseBecomePartial(vmobject: VMobject, a: number, b: number): this;
|
|
375
|
+
/**
|
|
376
|
+
* A new VMobject holding the portion of this curve between proportions a and b.
|
|
377
|
+
*
|
|
378
|
+
* For a closed path with a > b the subcurve wraps around the seam (the end
|
|
379
|
+
* portion [a, 1] followed by the start portion [0, b]), matching Manim CE's
|
|
380
|
+
* `get_subcurve`. Style is copied from this object.
|
|
381
|
+
*
|
|
382
|
+
* @param a - Start proportion in [0, 1]
|
|
383
|
+
* @param b - End proportion in [0, 1]
|
|
384
|
+
* @returns A new VMobject for the subcurve
|
|
385
|
+
*/
|
|
386
|
+
getSubcurve(a: number, b: number): VMobject;
|
|
387
|
+
/**
|
|
388
|
+
* Recompute handles so the path is a smooth C1-continuous spline through its
|
|
389
|
+
* anchors (Manim CE's `make_smooth`). Applies to every family member that
|
|
390
|
+
* owns points. Chainable.
|
|
391
|
+
*
|
|
392
|
+
* @returns this for chaining
|
|
393
|
+
*/
|
|
394
|
+
makeSmooth(): this;
|
|
395
|
+
/**
|
|
396
|
+
* Recompute handles so every segment is a straight line between its anchors
|
|
397
|
+
* (Manim CE's `make_jagged`). Applies to every family member that owns
|
|
398
|
+
* points. Chainable.
|
|
399
|
+
*
|
|
400
|
+
* @returns this for chaining
|
|
401
|
+
*/
|
|
402
|
+
makeJagged(): this;
|
|
403
|
+
/**
|
|
404
|
+
* Replace each sharp corner with a circular arc of the given radius
|
|
405
|
+
* (Manim CE's `round_corners`). Reads the path as a polygon through its
|
|
406
|
+
* anchors and inserts, at every corner, an arc tangent to both adjacent
|
|
407
|
+
* edges. The offset from each corner is clamped to half the shorter adjacent
|
|
408
|
+
* edge, so arcs on short edges never overlap. Convex and reflex corners both
|
|
409
|
+
* round correctly. A collinear corner and a non-positive radius leave the
|
|
410
|
+
* corner sharp. A closed path rounds every vertex; an open path keeps its two
|
|
411
|
+
* end vertices sharp. Applies to every family member that owns points.
|
|
412
|
+
* Chainable.
|
|
413
|
+
*
|
|
414
|
+
* @param radius - Corner radius; <= 0 is a no-op
|
|
415
|
+
* @returns this for chaining
|
|
416
|
+
*/
|
|
417
|
+
roundCorners(radius: number): this;
|
|
418
|
+
/**
|
|
419
|
+
* Distribute colors across this object's submobjects along a gradient
|
|
420
|
+
* (Manim CE's `set_color_by_gradient` submobject variant). Each family member
|
|
421
|
+
* that owns points gets one interpolated color. With a single color this is
|
|
422
|
+
* equivalent to {@link setColor}.
|
|
423
|
+
*
|
|
424
|
+
* @param colors - Two or more gradient colors
|
|
425
|
+
* @returns this for chaining
|
|
426
|
+
*/
|
|
427
|
+
setColorByGradient(...colors: string[]): this;
|
|
285
428
|
/**
|
|
286
429
|
* Clean up Three.js resources
|
|
287
430
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VMobject.d.ts","sourceRoot":"","sources":["../../src/core/VMobject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAW,YAAY,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"VMobject.d.ts","sourceRoot":"","sources":["../../src/core/VMobject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAW,YAAY,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAmB9C,YAAY,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,qBAAa,QAAS,SAAQ,iBAAiB;IAC7C;;;;OAIG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAAM;IAErC,sDAAsD;IACtD,SAAS,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEnD,kFAAkF;IAClF,SAAS,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzC,4EAA4E;IAC5E,SAAS,CAAC,wBAAwB,CAAC,EAAE,MAAM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AW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,QAAQ;IAqB3C;;;;;;OAMG;IACH,UAAU,IAAI,IAAI;IAUlB;;;;;;OAMG;IACH,UAAU,IAAI,IAAI;IASlB;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAYlC;;;;;;;;OAQG;IACH,kBAAkB,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IAc7C;;OAEG;IACM,OAAO,IAAI,IAAI;CAIzB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure color-gradient helper for VMobject.setColorByGradient.
|
|
3
|
+
*
|
|
4
|
+
* Interpolates a list of reference colors into `count` evenly spaced colors,
|
|
5
|
+
* porting Manim CE's `color_gradient`. Colors are parsed and interpolated in
|
|
6
|
+
* RGB via THREE.Color and returned as `#rrggbb` hex strings.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Produce `count` colors evenly interpolated across the reference colors.
|
|
10
|
+
*
|
|
11
|
+
* Positions are `linspace(0, K-1, count)` over the K reference colors; each
|
|
12
|
+
* output blends the two bracketing references. Matches Manim CE semantics,
|
|
13
|
+
* including the fix for the final element.
|
|
14
|
+
*
|
|
15
|
+
* @param colors - Reference colors (any THREE-parsable string)
|
|
16
|
+
* @param count - Number of output colors
|
|
17
|
+
* @returns Array of `#rrggbb` strings (length `count`)
|
|
18
|
+
*/
|
|
19
|
+
export declare function colorGradient(colors: string[], count: number): string[];
|
|
20
|
+
//# sourceMappingURL=VMobjectColorGradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VMobjectColorGradient.d.ts","sourceRoot":"","sources":["../../src/core/VMobjectColorGradient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA0BvE"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure math helpers for VMobject cubic-Bezier curve operations.
|
|
3
|
+
*
|
|
4
|
+
* This module contains only pure functions over point arrays (`number[][]`).
|
|
5
|
+
* It never constructs VMobject instances, so it has no import cycle with
|
|
6
|
+
* VMobject.ts. The VMobject class imports these helpers and wraps them as
|
|
7
|
+
* methods, which keeps VMobject.ts smaller and the math independently testable.
|
|
8
|
+
*
|
|
9
|
+
* Point layout (shared-anchor cubic Bezier chain, matching VMobject):
|
|
10
|
+
* [A0, H1, H2, A1, H3, H4, A2, ...]
|
|
11
|
+
* Each cubic segment c uses points[3c .. 3c+3]; consecutive segments share
|
|
12
|
+
* an anchor. A chain of n cubics has 3n+1 points and n+1 anchors.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Point at arc-length proportion `alpha` along a cubic Bezier point chain.
|
|
16
|
+
*
|
|
17
|
+
* `alpha` is measured by cumulative arc length, not by segment index, so a
|
|
18
|
+
* proportion of 0.5 is the geometric midpoint of the whole path. Matches
|
|
19
|
+
* Manim CE's `point_from_proportion`.
|
|
20
|
+
*
|
|
21
|
+
* @param points - Shared-anchor cubic Bezier point chain
|
|
22
|
+
* @param alpha - Proportion in [0, 1]
|
|
23
|
+
* @param samplesPerSegment - Samples per cubic segment for length estimation
|
|
24
|
+
* @returns Point as [x, y, z]
|
|
25
|
+
* @throws Error when the chain has no points
|
|
26
|
+
*/
|
|
27
|
+
export declare function pointFromProportionOnPath(points: number[][], alpha: number, samplesPerSegment?: number): [number, number, number];
|
|
28
|
+
/**
|
|
29
|
+
* Arc-length proportion of the point on the chain nearest to `point`.
|
|
30
|
+
*
|
|
31
|
+
* Samples the whole path, finds the nearest sample, and returns its cumulative
|
|
32
|
+
* arc length divided by the total. This is a monotone inverse of
|
|
33
|
+
* {@link pointFromProportionOnPath} that round-trips to sample resolution.
|
|
34
|
+
*
|
|
35
|
+
* @param points - Shared-anchor cubic Bezier point chain
|
|
36
|
+
* @param point - Query point [x, y, z]
|
|
37
|
+
* @param samplesPerSegment - Samples per cubic segment
|
|
38
|
+
* @returns Proportion in [0, 1]
|
|
39
|
+
*/
|
|
40
|
+
export declare function proportionFromPointOnPath(points: number[][], point: number[], samplesPerSegment?: number): number;
|
|
41
|
+
/**
|
|
42
|
+
* Control points of the portion of a Bezier curve between parameters a and b.
|
|
43
|
+
*
|
|
44
|
+
* Direct port of Manim CE's `partial_bezier_points`. Works for any degree; the
|
|
45
|
+
* result has the same number of control points as the input.
|
|
46
|
+
*
|
|
47
|
+
* @param controls - Control points of the full curve
|
|
48
|
+
* @param a - Start parameter in [0, 1]
|
|
49
|
+
* @param b - End parameter in [0, 1], b >= a
|
|
50
|
+
*/
|
|
51
|
+
export declare function partialBezierPoints(controls: number[][], a: number, b: number): number[][];
|
|
52
|
+
/**
|
|
53
|
+
* Integer-and-residue split of `alpha` over the range [start, end).
|
|
54
|
+
* Port of Manim CE's `integer_interpolate`.
|
|
55
|
+
*
|
|
56
|
+
* @returns [integer index, fractional residue in [0, 1]]
|
|
57
|
+
*/
|
|
58
|
+
export declare function integerInterpolate(start: number, end: number, alpha: number): [number, number];
|
|
59
|
+
/**
|
|
60
|
+
* Build the shared-anchor point chain for the partial path of `points`
|
|
61
|
+
* between arc-index proportions a and b.
|
|
62
|
+
*
|
|
63
|
+
* Port of Manim CE's `pointwise_become_partial`, adapted to the shared-anchor
|
|
64
|
+
* layout (each appended cubic after the first contributes only its last three
|
|
65
|
+
* points, dropping the duplicated start anchor).
|
|
66
|
+
*
|
|
67
|
+
* @param points - Source shared-anchor cubic Bezier point chain
|
|
68
|
+
* @param a - Start proportion in [0, 1]
|
|
69
|
+
* @param b - End proportion in [0, 1]
|
|
70
|
+
* @returns New point chain for the partial path
|
|
71
|
+
*/
|
|
72
|
+
export declare function partialPathPoints(points: number[][], a: number, b: number): number[][];
|
|
73
|
+
/**
|
|
74
|
+
* Anchor points of a shared-anchor cubic Bezier chain.
|
|
75
|
+
* A chain of n cubics has anchors at points[0], points[3], ..., points[3n].
|
|
76
|
+
*/
|
|
77
|
+
export declare function anchorsFromPoints(points: number[][]): number[][];
|
|
78
|
+
/**
|
|
79
|
+
* Smooth cubic-Bezier handles for a sequence of anchors (open spline).
|
|
80
|
+
*
|
|
81
|
+
* Solves the tridiagonal system for a C1-continuous spline through the anchors
|
|
82
|
+
* (the classic "smooth bezier spline" formulation that Manim CE's
|
|
83
|
+
* `get_smooth_handle_points` computes). For each internal anchor the incoming
|
|
84
|
+
* second handle and outgoing first handle are reflections through the anchor,
|
|
85
|
+
* giving tangent continuity.
|
|
86
|
+
*
|
|
87
|
+
* Closed paths are smoothed as an open spline over the repeated-endpoint
|
|
88
|
+
* anchor list, so the seam is not periodic-smooth.
|
|
89
|
+
*
|
|
90
|
+
* @param anchors - Anchor points (length n+1 for n segments)
|
|
91
|
+
* @returns First and second handles, one each per segment (length n)
|
|
92
|
+
*/
|
|
93
|
+
export declare function smoothHandlePoints(anchors: number[][]): {
|
|
94
|
+
h1: number[][];
|
|
95
|
+
h2: number[][];
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Append `newPoints` to a shared-anchor cubic chain, returning the joined chain.
|
|
99
|
+
*
|
|
100
|
+
* Port of Manim CE's `append_points`, adapted to the shared-anchor layout. CE
|
|
101
|
+
* stores each cubic as four independent points and concatenates raw, so the
|
|
102
|
+
* join anchor appears twice. Here consecutive cubics share their boundary
|
|
103
|
+
* anchor, so when the existing chain is non-empty the first appended anchor
|
|
104
|
+
* continues from the last existing anchor and is dropped. With `existing` of
|
|
105
|
+
* 3k+1 points and `newPoints` of 3m+1 points the result has 3(k+m)+1 points.
|
|
106
|
+
*
|
|
107
|
+
* @param existing - Current shared-anchor chain (may be empty)
|
|
108
|
+
* @param newPoints - Points to append (a shared-anchor chain on its own)
|
|
109
|
+
* @returns New joined chain; `existing` and `newPoints` are not mutated
|
|
110
|
+
*/
|
|
111
|
+
export declare function appendPointsToPointList(existing: number[][], newPoints: number[][]): number[][];
|
|
112
|
+
/**
|
|
113
|
+
* Subdivide a shared-anchor chain so it contains exactly `n` more cubics.
|
|
114
|
+
*
|
|
115
|
+
* Port of Manim CE's `insert_n_curves_to_point_list`. Each existing cubic is
|
|
116
|
+
* split into as many equal-parameter sub-cubics as `bezier_remap` requires, so
|
|
117
|
+
* the sampled curve is unchanged and the curve count rises by exactly `n`.
|
|
118
|
+
*
|
|
119
|
+
* @param n - Number of cubics to add (<= 0 returns a copy)
|
|
120
|
+
* @param points - Source shared-anchor cubic chain
|
|
121
|
+
* @returns New chain with `numCurves + n` cubics
|
|
122
|
+
*/
|
|
123
|
+
export declare function insertNCurvesToPointList(n: number, points: number[][]): number[][];
|
|
124
|
+
/**
|
|
125
|
+
* Assemble a shared-anchor point chain from anchors and per-segment handles.
|
|
126
|
+
*/
|
|
127
|
+
export declare function chainFromAnchorsAndHandles(anchors: number[][], h1: number[][], h2: number[][]): number[][];
|
|
128
|
+
//# sourceMappingURL=VMobjectCurveMath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VMobjectCurveMath.d.ts","sourceRoot":"","sources":["../../src/core/VMobjectCurveMath.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAsDH;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EAAE,EAAE,EAClB,KAAK,EAAE,MAAM,EACb,iBAAiB,SAAK,GACrB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CA0B1B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EAAE,EAAE,EAClB,KAAK,EAAE,MAAM,EAAE,EACf,iBAAiB,SAAK,GACrB,MAAM,CA4BR;AAuBD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,M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Line2.js';
|
|
1
2
|
import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial.js';
|
|
2
3
|
import { Mobject } from './Mobject';
|
|
3
4
|
import { Point } from './VMobjectCurves';
|
|
@@ -107,6 +108,19 @@ export declare abstract class VMobjectRendering extends Mobject {
|
|
|
107
108
|
set shaderCurves(value: boolean | null);
|
|
108
109
|
/** Mark geometry as needing rebuild on next render. */
|
|
109
110
|
markGeometryDirty(): void;
|
|
111
|
+
/**
|
|
112
|
+
* This VMobject's own stroke Line2 primitives (one per subpath), synced on
|
|
113
|
+
* demand. Scoped strictly to this instance's rendering cache — never
|
|
114
|
+
* includes descendants' primitives. Lets callers (e.g. Create's lagRatio
|
|
115
|
+
* stagger) drive exactly one mobject's own segments without walking the
|
|
116
|
+
* Three.js scene graph, which cannot distinguish "another family member"
|
|
117
|
+
* from "another subpath of this same member".
|
|
118
|
+
*
|
|
119
|
+
* `_cachedLine2`/`_cachedLine2Array` stay private and mutable internally
|
|
120
|
+
* (which cache is active is an implementation detail); this returns a
|
|
121
|
+
* fresh array so callers cannot corrupt that internal state.
|
|
122
|
+
*/
|
|
123
|
+
getOwnStrokeLines(): Line2[];
|
|
110
124
|
/**
|
|
111
125
|
* VMobject-level upward dirty propagation must also mark geometry dirty.
|
|
112
126
|
* This keeps geometry invalidation centralized for point/curve mutations.
|
|
@@ -124,7 +138,11 @@ export declare abstract class VMobjectRendering extends Mobject {
|
|
|
124
138
|
/**
|
|
125
139
|
* Update the geometry within the Three.js group.
|
|
126
140
|
*/
|
|
127
|
-
protected _updateGeometry(group: THREE.Group
|
|
141
|
+
protected _updateGeometry(group: THREE.Group, options?: {
|
|
142
|
+
strokeOnly?: boolean;
|
|
143
|
+
}): void;
|
|
144
|
+
/** Rebuild or dispose the earcut fill mesh for the current points. */
|
|
145
|
+
private _updateFillGeometry;
|
|
128
146
|
private _updateLine2Stroke;
|
|
129
147
|
private _updateLine2StrokeMulti;
|
|
130
148
|
/**
|
|
@@ -138,6 +156,25 @@ export declare abstract class VMobjectRendering extends Mobject {
|
|
|
138
156
|
private _updateBezierStroke;
|
|
139
157
|
private _disposeGroupChildren;
|
|
140
158
|
protected _syncMaterialToThree(): void;
|
|
159
|
+
/**
|
|
160
|
+
* Keep geometry consistent with the current opacity after a material sync.
|
|
161
|
+
*
|
|
162
|
+
* A pending geometry change forces a full rebuild. Otherwise, crossing the
|
|
163
|
+
* opacity-1.0 boundary is a material-only update: it flips the stroke
|
|
164
|
+
* materials' transparent/depthWrite state (which three.js recompiles only
|
|
165
|
+
* when needsUpdate bumps the version) and rebuilds only the stroke when its
|
|
166
|
+
* geometry depends on opacity, never the opacity-independent fill. Rebuilding
|
|
167
|
+
* the fill on every FadeIn completion froze large groups (issue #548).
|
|
168
|
+
*/
|
|
169
|
+
private _syncGeometryForOpacity;
|
|
170
|
+
/**
|
|
171
|
+
* Whether the stroke geometry changes when opacity crosses the 1.0 boundary.
|
|
172
|
+
*
|
|
173
|
+
* Line2 strokes add corner-wrap points for closed paths only at full opacity,
|
|
174
|
+
* and the shader stroke bakes opacity into per-segment instance colors. The
|
|
175
|
+
* mesh stroke geometry ignores opacity, so it needs no rebuild.
|
|
176
|
+
*/
|
|
177
|
+
private _strokeGeometryDependsOnOpacity;
|
|
141
178
|
protected _disposeRenderingResources(): void;
|
|
142
179
|
}
|
|
143
180
|
//# sourceMappingURL=VMobjectRendering.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VMobjectRendering.d.ts","sourceRoot":"","sources":["../../src/core/VMobjectRendering.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"VMobjectRendering.d.ts","sourceRoot":"","sources":["../../src/core/VMobjectRendering.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,mCAA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G,IAAI;IAYrF;;OAEG;IACH,SAAS,CAAC,kBAAkB,IAAI,KAAK,CAAC,QAAQ;IA0B9C;;OAEG;IACH,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;IAuDvF,sEAAsE;IACtE,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,kBAAkB;IAsC1B,OAAO,CAAC,uBAAuB;IAkD/B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA6B5B,OAAO,CAAC,iBAAiB;IAsCzB,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,mBAAmB;IA6C3B,OAAO,CAAC,qBAAqB;cAcV,oBAAoB,IAAI,IAAI;IA6C/C;;;;;;;;;OASG;IACH,OAAO,CAAC,uBAAuB;IAoB/B;;;;;;OAMG;IACH,OAAO,CAAC,+BAA+B;IAWvC,SAAS,CAAC,0BAA0B,IAAI,IAAI;CAuB7C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure math for VMobject.roundCorners (Manim CE's `round_corners`).
|
|
3
|
+
*
|
|
4
|
+
* This module holds only pure functions over point arrays (`number[][]`). It
|
|
5
|
+
* builds no VMobject instances, so it has no import cycle with VMobject.ts. The
|
|
6
|
+
* VMobject class imports `roundCornersPoints` and wraps it as a method.
|
|
7
|
+
*
|
|
8
|
+
* Point layout (shared-anchor cubic Bezier chain, matching VMobject):
|
|
9
|
+
* [A0, H1, H2, A1, H3, H4, A2, ...]
|
|
10
|
+
* A chain of n cubics has 3n+1 points and n+1 anchors. This differs from CE's
|
|
11
|
+
* 4-points-per-cubic layout: here consecutive cubics share one anchor.
|
|
12
|
+
*
|
|
13
|
+
* Algorithm (per corner vertex V with incoming edge from A and outgoing edge
|
|
14
|
+
* to B): move back from V along both edges by one offset `d`, then join the two
|
|
15
|
+
* offset points with a circular arc tangent to both edges. The offset is
|
|
16
|
+
* clamped to half of the shorter adjacent edge so arcs on short edges never
|
|
17
|
+
* overlap. The arc bulges to the side set by the sign of the turn, so convex
|
|
18
|
+
* and reflex corners both round correctly. A collinear corner and a zero
|
|
19
|
+
* radius leave the corner sharp. An open path keeps its two end vertices sharp.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Replace each sharp corner of a polygonal point chain with a circular arc of
|
|
23
|
+
* the given radius (Manim CE's `round_corners`).
|
|
24
|
+
*
|
|
25
|
+
* The chain is read as a polygon through its anchors; edges are straight lines
|
|
26
|
+
* between anchors. Convex and reflex corners both round, with the arc bulging
|
|
27
|
+
* to the side set by the turn sign. Collinear corners and a non-positive radius
|
|
28
|
+
* leave the chain unchanged. A closed path rounds every vertex; an open path
|
|
29
|
+
* keeps its first and last vertices sharp.
|
|
30
|
+
*
|
|
31
|
+
* @param points - Source shared-anchor cubic Bezier chain
|
|
32
|
+
* @param radius - Corner radius; <= 0 returns a copy unchanged
|
|
33
|
+
* @param componentsPerCorner - Cubic segments per rounded corner (default 2)
|
|
34
|
+
* @returns A new shared-anchor chain with rounded corners
|
|
35
|
+
*/
|
|
36
|
+
export declare function roundCornersPoints(points: number[][], radius: number, componentsPerCorner?: number): number[][];
|
|
37
|
+
//# sourceMappingURL=VMobjectRoundCorners.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VMobjectRoundCorners.d.ts","sourceRoot":"","sources":["../../src/core/VMobjectRoundCorners.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA0KH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EAAE,EAAE,EAClB,MAAM,EAAE,MAAM,EACd,mBAAmB,GAAE,MAAsC,GAC1D,MAAM,EAAE,EAAE,CA4CZ"}
|