manim-web 0.3.23 → 0.10.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/{MathJaxBundle-xSidSV0E.js → MathJaxBundle-BSrlS0Dh.js} +3338 -3320
- 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 +18 -1
- 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/ThreeDScene.d.ts +27 -0
- package/dist/core/ThreeDScene.d.ts.map +1 -1
- 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/GifExporter.d.ts +4 -0
- package/dist/export/GifExporter.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 +26 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/integrations/react.js +16 -16
- package/dist/integrations/vue.js +15 -15
- package/dist/manim-web.browser.js +16263 -8560
- 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/point/PMobject.d.ts +1 -1
- package/dist/mobjects/point/PMobject.d.ts.map +1 -1
- 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/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/renderer-DR_79fB0.js +2 -0
- package/dist/{src-Bm3ebFjQ.js → src-D29Z9zIa.js} +8840 -6004
- 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/package.json +11 -7
|
@@ -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":"VMobjectCurveM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AuB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAI/F;AAWD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAoBlF;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EAAE,EAAE,EACnB,EAAE,EAAE,MAAM,EAAE,EAAE,EACd,EAAE,EAAE,MAAM,EAAE,EAAE,GACb,MAAM,EAAE,EAAE,CAUZ"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Line2 } from 'three/examples/jsm/lines/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,mCAAmC,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAExE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAU9C;;;;;;;GAOG;AACH,8BAAsB,iBAAkB,SAAQ,OAAO;IACrD,sEAAsE;IACtE,SAAS,CAAC,eAAe,EAAE,YAAY,GAAG,IAAI,CAAQ;IAEtD,6BAA6B;IAC7B,SAAS,CAAC,aAAa,EAAE,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAQ;IAE/D,oEAAoE;IACpE,SAAS,CAAC,cAAc,EAAE,OAAO,CAAQ;IAEzC,kFAAkF;IAClF,OAAO,CAAC,UAAU,CAAiB;IAEnC,2EAA2E;IAC3E,OAAO,CAAC,YAAY,CAAsB;IAE1C,4DAA4D;IAC5D,OAAO,CAAC,iBAAiB,CAAe;IAExC,qDAAqD;IACrD,OAAO,CAAC,eAAe,CAA2B;IAElD;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe,CAAK;IACnC,OAAO,CAAC,WAAW,CAA2D;IAE9E,0DAA0D;IAC1D,MAAM,CA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ject.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"}
|