manim-web 0.2.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/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/animation/Animation.d.ts +69 -0
- package/dist/animation/Animation.d.ts.map +1 -0
- package/dist/animation/AnimationGroup.d.ts +48 -0
- package/dist/animation/AnimationGroup.d.ts.map +1 -0
- package/dist/animation/LaggedStart.d.ts +25 -0
- package/dist/animation/LaggedStart.d.ts.map +1 -0
- package/dist/animation/MaintainPositionRelativeTo.d.ts +23 -0
- package/dist/animation/MaintainPositionRelativeTo.d.ts.map +1 -0
- package/dist/animation/Succession.d.ts +19 -0
- package/dist/animation/Succession.d.ts.map +1 -0
- package/dist/animation/Timeline.d.ts +89 -0
- package/dist/animation/Timeline.d.ts.map +1 -0
- package/dist/animation/UpdateFromAlphaFunc.d.ts +32 -0
- package/dist/animation/UpdateFromAlphaFunc.d.ts.map +1 -0
- package/dist/animation/UpdateFromFunc.d.ts +30 -0
- package/dist/animation/UpdateFromFunc.d.ts.map +1 -0
- package/dist/animation/changing/index.d.ts +213 -0
- package/dist/animation/changing/index.d.ts.map +1 -0
- package/dist/animation/composition/LaggedStartMap.d.ts +47 -0
- package/dist/animation/composition/LaggedStartMap.d.ts.map +1 -0
- package/dist/animation/composition/index.d.ts +5 -0
- package/dist/animation/composition/index.d.ts.map +1 -0
- package/dist/animation/creation/Create.d.ts +232 -0
- package/dist/animation/creation/Create.d.ts.map +1 -0
- package/dist/animation/creation/CreationExtensions.d.ts +127 -0
- package/dist/animation/creation/CreationExtensions.d.ts.map +1 -0
- package/dist/animation/creation/TypeWithCursor.d.ts +133 -0
- package/dist/animation/creation/TypeWithCursor.d.ts.map +1 -0
- package/dist/animation/creation/index.d.ts +4 -0
- package/dist/animation/creation/index.d.ts.map +1 -0
- package/dist/animation/fading/FadeIn.d.ts +31 -0
- package/dist/animation/fading/FadeIn.d.ts.map +1 -0
- package/dist/animation/fading/FadeOut.d.ts +32 -0
- package/dist/animation/fading/FadeOut.d.ts.map +1 -0
- package/dist/animation/fading/index.d.ts +3 -0
- package/dist/animation/fading/index.d.ts.map +1 -0
- package/dist/animation/growing/index.d.ts +103 -0
- package/dist/animation/growing/index.d.ts.map +1 -0
- package/dist/animation/index.d.ts +20 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/indication/ApplyWave.d.ts +51 -0
- package/dist/animation/indication/ApplyWave.d.ts.map +1 -0
- package/dist/animation/indication/Blink.d.ts +34 -0
- package/dist/animation/indication/Blink.d.ts.map +1 -0
- package/dist/animation/indication/Circumscribe.d.ts +54 -0
- package/dist/animation/indication/Circumscribe.d.ts.map +1 -0
- package/dist/animation/indication/Flash.d.ts +45 -0
- package/dist/animation/indication/Flash.d.ts.map +1 -0
- package/dist/animation/indication/FocusOn.d.ts +79 -0
- package/dist/animation/indication/FocusOn.d.ts.map +1 -0
- package/dist/animation/indication/Indicate.d.ts +30 -0
- package/dist/animation/indication/Indicate.d.ts.map +1 -0
- package/dist/animation/indication/ShowCreationThenDestruction.d.ts +26 -0
- package/dist/animation/indication/ShowCreationThenDestruction.d.ts.map +1 -0
- package/dist/animation/indication/ShowPassingFlash.d.ts +47 -0
- package/dist/animation/indication/ShowPassingFlash.d.ts.map +1 -0
- package/dist/animation/indication/ShowPassingFlashWithThinningStrokeWidth.d.ts +21 -0
- package/dist/animation/indication/ShowPassingFlashWithThinningStrokeWidth.d.ts.map +1 -0
- package/dist/animation/indication/Wiggle.d.ts +48 -0
- package/dist/animation/indication/Wiggle.d.ts.map +1 -0
- package/dist/animation/indication/WiggleOutThenIn.d.ts +44 -0
- package/dist/animation/indication/WiggleOutThenIn.d.ts.map +1 -0
- package/dist/animation/indication/index.d.ts +20 -0
- package/dist/animation/indication/index.d.ts.map +1 -0
- package/dist/animation/movement/Homotopy.d.ts +204 -0
- package/dist/animation/movement/Homotopy.d.ts.map +1 -0
- package/dist/animation/movement/MoveAlongPath.d.ts +48 -0
- package/dist/animation/movement/MoveAlongPath.d.ts.map +1 -0
- package/dist/animation/movement/Rotate.d.ts +47 -0
- package/dist/animation/movement/Rotate.d.ts.map +1 -0
- package/dist/animation/movement/Scale.d.ts +74 -0
- package/dist/animation/movement/Scale.d.ts.map +1 -0
- package/dist/animation/movement/Shift.d.ts +74 -0
- package/dist/animation/movement/Shift.d.ts.map +1 -0
- package/dist/animation/movement/index.d.ts +6 -0
- package/dist/animation/movement/index.d.ts.map +1 -0
- package/dist/animation/numbers/index.d.ts +152 -0
- package/dist/animation/numbers/index.d.ts.map +1 -0
- package/dist/animation/speed/index.d.ts +114 -0
- package/dist/animation/speed/index.d.ts.map +1 -0
- package/dist/animation/transform/ApplyPointwiseFunction.d.ts +23 -0
- package/dist/animation/transform/ApplyPointwiseFunction.d.ts.map +1 -0
- package/dist/animation/transform/Transform.d.ts +89 -0
- package/dist/animation/transform/Transform.d.ts.map +1 -0
- package/dist/animation/transform/TransformExtensions.d.ts +444 -0
- package/dist/animation/transform/TransformExtensions.d.ts.map +1 -0
- package/dist/animation/transform/TransformMatching.d.ts +138 -0
- package/dist/animation/transform/TransformMatching.d.ts.map +1 -0
- package/dist/animation/transform/index.d.ts +5 -0
- package/dist/animation/transform/index.d.ts.map +1 -0
- package/dist/animation/utility/index.d.ts +171 -0
- package/dist/animation/utility/index.d.ts.map +1 -0
- package/dist/constants/colors.d.ts +72 -0
- package/dist/constants/colors.d.ts.map +1 -0
- package/dist/constants/colors.test.d.ts +2 -0
- package/dist/constants/colors.test.d.ts.map +1 -0
- package/dist/constants/directions.test.d.ts +2 -0
- package/dist/constants/directions.test.d.ts.map +1 -0
- package/dist/constants/index.d.ts +16 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/core/AudioManager.d.ts +203 -0
- package/dist/core/AudioManager.d.ts.map +1 -0
- package/dist/core/Camera.d.ts +172 -0
- package/dist/core/Camera.d.ts.map +1 -0
- package/dist/core/Camera2DFrame.d.ts +31 -0
- package/dist/core/Camera2DFrame.d.ts.map +1 -0
- package/dist/core/CameraExtensions.d.ts +420 -0
- package/dist/core/CameraExtensions.d.ts.map +1 -0
- package/dist/core/CameraFrame.d.ts +178 -0
- package/dist/core/CameraFrame.d.ts.map +1 -0
- package/dist/core/Group.d.ts +139 -0
- package/dist/core/Group.d.ts.map +1 -0
- package/dist/core/InteractiveScene.d.ts +122 -0
- package/dist/core/InteractiveScene.d.ts.map +1 -0
- package/dist/core/Lighting.d.ts +128 -0
- package/dist/core/Lighting.d.ts.map +1 -0
- package/dist/core/Mobject.d.ts +488 -0
- package/dist/core/Mobject.d.ts.map +1 -0
- package/dist/core/Renderer.d.ts +84 -0
- package/dist/core/Renderer.d.ts.map +1 -0
- package/dist/core/Scene.d.ts +353 -0
- package/dist/core/Scene.d.ts.map +1 -0
- package/dist/core/SceneExtensions.d.ts +640 -0
- package/dist/core/SceneExtensions.d.ts.map +1 -0
- package/dist/core/SceneExtensions.test.d.ts +2 -0
- package/dist/core/SceneExtensions.test.d.ts.map +1 -0
- package/dist/core/StateManager.d.ts +193 -0
- package/dist/core/StateManager.d.ts.map +1 -0
- package/dist/core/VDict.d.ts +229 -0
- package/dist/core/VDict.d.ts.map +1 -0
- package/dist/core/VGroup.d.ts +200 -0
- package/dist/core/VGroup.d.ts.map +1 -0
- package/dist/core/VMobject.d.ts +419 -0
- package/dist/core/VMobject.d.ts.map +1 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/examples.test.d.ts +2 -0
- package/dist/examples.test.d.ts.map +1 -0
- package/dist/export/GifExporter.d.ts +40 -0
- package/dist/export/GifExporter.d.ts.map +1 -0
- package/dist/export/VideoExporter.d.ts +135 -0
- package/dist/export/VideoExporter.d.ts.map +1 -0
- package/dist/export/index.d.ts +3 -0
- package/dist/export/index.d.ts.map +1 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49064 -0
- package/dist/integrations/index.d.ts +1 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/react.d.ts +144 -0
- package/dist/integrations/react.d.ts.map +1 -0
- package/dist/integrations/react.js +570 -0
- package/dist/integrations/vue.d.ts +249 -0
- package/dist/integrations/vue.d.ts.map +1 -0
- package/dist/integrations/vue.js +560 -0
- package/dist/interaction/Clickable.d.ts +71 -0
- package/dist/interaction/Clickable.d.ts.map +1 -0
- package/dist/interaction/Controls.d.ts +174 -0
- package/dist/interaction/Controls.d.ts.map +1 -0
- package/dist/interaction/Draggable.d.ts +88 -0
- package/dist/interaction/Draggable.d.ts.map +1 -0
- package/dist/interaction/Hoverable.d.ts +82 -0
- package/dist/interaction/Hoverable.d.ts.map +1 -0
- package/dist/interaction/OrbitControls.d.ts +139 -0
- package/dist/interaction/OrbitControls.d.ts.map +1 -0
- package/dist/interaction/PlaybackControls.d.ts +113 -0
- package/dist/interaction/PlaybackControls.d.ts.map +1 -0
- package/dist/interaction/SelectionManager.d.ts +125 -0
- package/dist/interaction/SelectionManager.d.ts.map +1 -0
- package/dist/interaction/index.d.ts +12 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/mobjects/fractals/MandelbrotSet.d.ts +92 -0
- package/dist/mobjects/fractals/MandelbrotSet.d.ts.map +1 -0
- package/dist/mobjects/fractals/NewtonFractal.d.ts +121 -0
- package/dist/mobjects/fractals/NewtonFractal.d.ts.map +1 -0
- package/dist/mobjects/fractals/index.d.ts +3 -0
- package/dist/mobjects/fractals/index.d.ts.map +1 -0
- package/dist/mobjects/frame/index.d.ts +188 -0
- package/dist/mobjects/frame/index.d.ts.map +1 -0
- package/dist/mobjects/geometry/AngleShapes.d.ts +326 -0
- package/dist/mobjects/geometry/AngleShapes.d.ts.map +1 -0
- package/dist/mobjects/geometry/Arc.d.ts +111 -0
- package/dist/mobjects/geometry/Arc.d.ts.map +1 -0
- package/dist/mobjects/geometry/ArcBetweenPoints.d.ts +68 -0
- package/dist/mobjects/geometry/ArcBetweenPoints.d.ts.map +1 -0
- package/dist/mobjects/geometry/ArcShapes.d.ts +659 -0
- package/dist/mobjects/geometry/ArcShapes.d.ts.map +1 -0
- package/dist/mobjects/geometry/Arrow.d.ts +130 -0
- package/dist/mobjects/geometry/Arrow.d.ts.map +1 -0
- package/dist/mobjects/geometry/ArrowTips.d.ts +238 -0
- package/dist/mobjects/geometry/ArrowTips.d.ts.map +1 -0
- package/dist/mobjects/geometry/BooleanOperations.d.ts +163 -0
- package/dist/mobjects/geometry/BooleanOperations.d.ts.map +1 -0
- package/dist/mobjects/geometry/Circle.d.ts +92 -0
- package/dist/mobjects/geometry/Circle.d.ts.map +1 -0
- package/dist/mobjects/geometry/CubicBezier.d.ts +126 -0
- package/dist/mobjects/geometry/CubicBezier.d.ts.map +1 -0
- package/dist/mobjects/geometry/DashedLine.d.ts +109 -0
- package/dist/mobjects/geometry/DashedLine.d.ts.map +1 -0
- package/dist/mobjects/geometry/DashedVMobject.d.ts +96 -0
- package/dist/mobjects/geometry/DashedVMobject.d.ts.map +1 -0
- package/dist/mobjects/geometry/Dot.d.ts +100 -0
- package/dist/mobjects/geometry/Dot.d.ts.map +1 -0
- package/dist/mobjects/geometry/LabeledGeometry.d.ts +372 -0
- package/dist/mobjects/geometry/LabeledGeometry.d.ts.map +1 -0
- package/dist/mobjects/geometry/Line.d.ts +83 -0
- package/dist/mobjects/geometry/Line.d.ts.map +1 -0
- package/dist/mobjects/geometry/Polygon.d.ts +155 -0
- package/dist/mobjects/geometry/Polygon.d.ts.map +1 -0
- package/dist/mobjects/geometry/PolygonExtensions.d.ts +412 -0
- package/dist/mobjects/geometry/PolygonExtensions.d.ts.map +1 -0
- package/dist/mobjects/geometry/Rectangle.d.ts +123 -0
- package/dist/mobjects/geometry/Rectangle.d.ts.map +1 -0
- package/dist/mobjects/geometry/ShapeMatchers.d.ts +252 -0
- package/dist/mobjects/geometry/ShapeMatchers.d.ts.map +1 -0
- package/dist/mobjects/geometry/index.d.ts +25 -0
- package/dist/mobjects/geometry/index.d.ts.map +1 -0
- package/dist/mobjects/graph/index.d.ts +425 -0
- package/dist/mobjects/graph/index.d.ts.map +1 -0
- package/dist/mobjects/graphing/Axes.d.ts +254 -0
- package/dist/mobjects/graphing/Axes.d.ts.map +1 -0
- package/dist/mobjects/graphing/BarChart.d.ts +241 -0
- package/dist/mobjects/graphing/BarChart.d.ts.map +1 -0
- package/dist/mobjects/graphing/ComplexPlane.d.ts +311 -0
- package/dist/mobjects/graphing/ComplexPlane.d.ts.map +1 -0
- package/dist/mobjects/graphing/FunctionGraph.d.ts +123 -0
- package/dist/mobjects/graphing/FunctionGraph.d.ts.map +1 -0
- package/dist/mobjects/graphing/ImplicitFunction.d.ts +131 -0
- package/dist/mobjects/graphing/ImplicitFunction.d.ts.map +1 -0
- package/dist/mobjects/graphing/NumberLine.d.ts +195 -0
- package/dist/mobjects/graphing/NumberLine.d.ts.map +1 -0
- package/dist/mobjects/graphing/NumberPlane.d.ts +91 -0
- package/dist/mobjects/graphing/NumberPlane.d.ts.map +1 -0
- package/dist/mobjects/graphing/ParametricFunction.d.ts +111 -0
- package/dist/mobjects/graphing/ParametricFunction.d.ts.map +1 -0
- package/dist/mobjects/graphing/Vector.d.ts +121 -0
- package/dist/mobjects/graphing/Vector.d.ts.map +1 -0
- package/dist/mobjects/graphing/VectorField.d.ts +321 -0
- package/dist/mobjects/graphing/VectorField.d.ts.map +1 -0
- package/dist/mobjects/graphing/index.d.ts +18 -0
- package/dist/mobjects/graphing/index.d.ts.map +1 -0
- package/dist/mobjects/image/index.d.ts +223 -0
- package/dist/mobjects/image/index.d.ts.map +1 -0
- package/dist/mobjects/matrix/Matrix.d.ts +260 -0
- package/dist/mobjects/matrix/Matrix.d.ts.map +1 -0
- package/dist/mobjects/matrix/index.d.ts +8 -0
- package/dist/mobjects/matrix/index.d.ts.map +1 -0
- package/dist/mobjects/point/index.d.ts +707 -0
- package/dist/mobjects/point/index.d.ts.map +1 -0
- package/dist/mobjects/probability/DiceFace.d.ts +137 -0
- package/dist/mobjects/probability/DiceFace.d.ts.map +1 -0
- package/dist/mobjects/probability/SampleSpace.d.ts +267 -0
- package/dist/mobjects/probability/SampleSpace.d.ts.map +1 -0
- package/dist/mobjects/probability/index.d.ts +9 -0
- package/dist/mobjects/probability/index.d.ts.map +1 -0
- package/dist/mobjects/svg/Brace.d.ts +308 -0
- package/dist/mobjects/svg/Brace.d.ts.map +1 -0
- package/dist/mobjects/svg/SVGMobject.d.ts +64 -0
- package/dist/mobjects/svg/SVGMobject.d.ts.map +1 -0
- package/dist/mobjects/svg/index.d.ts +10 -0
- package/dist/mobjects/svg/index.d.ts.map +1 -0
- package/dist/mobjects/table/Table.d.ts +315 -0
- package/dist/mobjects/table/Table.d.ts.map +1 -0
- package/dist/mobjects/table/index.d.ts +8 -0
- package/dist/mobjects/table/index.d.ts.map +1 -0
- package/dist/mobjects/text/Code.d.ts +244 -0
- package/dist/mobjects/text/Code.d.ts.map +1 -0
- package/dist/mobjects/text/DecimalNumber.d.ts +199 -0
- package/dist/mobjects/text/DecimalNumber.d.ts.map +1 -0
- package/dist/mobjects/text/GlyphVMobject.d.ts +76 -0
- package/dist/mobjects/text/GlyphVMobject.d.ts.map +1 -0
- package/dist/mobjects/text/MarkupText.d.ts +161 -0
- package/dist/mobjects/text/MarkupText.d.ts.map +1 -0
- package/dist/mobjects/text/MathJaxRenderer.d.ts +49 -0
- package/dist/mobjects/text/MathJaxRenderer.d.ts.map +1 -0
- package/dist/mobjects/text/MathTex.d.ts +242 -0
- package/dist/mobjects/text/MathTex.d.ts.map +1 -0
- package/dist/mobjects/text/Paragraph.d.ts +86 -0
- package/dist/mobjects/text/Paragraph.d.ts.map +1 -0
- package/dist/mobjects/text/Tex.d.ts +40 -0
- package/dist/mobjects/text/Tex.d.ts.map +1 -0
- package/dist/mobjects/text/Text.d.ts +171 -0
- package/dist/mobjects/text/Text.d.ts.map +1 -0
- package/dist/mobjects/text/TextExtensions.d.ts +383 -0
- package/dist/mobjects/text/TextExtensions.d.ts.map +1 -0
- package/dist/mobjects/text/TextGlyphGroup.d.ts +48 -0
- package/dist/mobjects/text/TextGlyphGroup.d.ts.map +1 -0
- package/dist/mobjects/text/Variable.d.ts +160 -0
- package/dist/mobjects/text/Variable.d.ts.map +1 -0
- package/dist/mobjects/text/index.d.ts +21 -0
- package/dist/mobjects/text/index.d.ts.map +1 -0
- package/dist/mobjects/text/katex-styles.d.ts +23 -0
- package/dist/mobjects/text/katex-styles.d.ts.map +1 -0
- package/dist/mobjects/text/svgPathParser.d.ts +39 -0
- package/dist/mobjects/text/svgPathParser.d.ts.map +1 -0
- package/dist/mobjects/three-d/Arrow3D.d.ts +136 -0
- package/dist/mobjects/three-d/Arrow3D.d.ts.map +1 -0
- package/dist/mobjects/three-d/Cube.d.ts +186 -0
- package/dist/mobjects/three-d/Cube.d.ts.map +1 -0
- package/dist/mobjects/three-d/Cylinder.d.ts +189 -0
- package/dist/mobjects/three-d/Cylinder.d.ts.map +1 -0
- package/dist/mobjects/three-d/Line3D.d.ts +100 -0
- package/dist/mobjects/three-d/Line3D.d.ts.map +1 -0
- package/dist/mobjects/three-d/ParametricSurface.d.ts +86 -0
- package/dist/mobjects/three-d/ParametricSurface.d.ts.map +1 -0
- package/dist/mobjects/three-d/Polyhedra.d.ts +271 -0
- package/dist/mobjects/three-d/Polyhedra.d.ts.map +1 -0
- package/dist/mobjects/three-d/Sphere.d.ts +100 -0
- package/dist/mobjects/three-d/Sphere.d.ts.map +1 -0
- package/dist/mobjects/three-d/Surface3D.d.ts +156 -0
- package/dist/mobjects/three-d/Surface3D.d.ts.map +1 -0
- package/dist/mobjects/three-d/TexturedSurface.d.ts +208 -0
- package/dist/mobjects/three-d/TexturedSurface.d.ts.map +1 -0
- package/dist/mobjects/three-d/ThreeDAxes.d.ts +172 -0
- package/dist/mobjects/three-d/ThreeDAxes.d.ts.map +1 -0
- package/dist/mobjects/three-d/ThreeDExtensions.d.ts +335 -0
- package/dist/mobjects/three-d/ThreeDExtensions.d.ts.map +1 -0
- package/dist/mobjects/three-d/Torus.d.ts +123 -0
- package/dist/mobjects/three-d/Torus.d.ts.map +1 -0
- package/dist/mobjects/three-d/index.d.ts +19 -0
- package/dist/mobjects/three-d/index.d.ts.map +1 -0
- package/dist/mobjects/value-tracker/ValueTracker.d.ts +248 -0
- package/dist/mobjects/value-tracker/ValueTracker.d.ts.map +1 -0
- package/dist/mobjects/value-tracker/index.d.ts +9 -0
- package/dist/mobjects/value-tracker/index.d.ts.map +1 -0
- package/dist/rate-functions/index.d.ts +81 -0
- package/dist/rate-functions/index.d.ts.map +1 -0
- package/dist/rate-functions/rateFunctions.test.d.ts +2 -0
- package/dist/rate-functions/rateFunctions.test.d.ts.map +1 -0
- package/dist/rendering/BezierRenderer.d.ts +112 -0
- package/dist/rendering/BezierRenderer.d.ts.map +1 -0
- package/dist/rendering/BezierShaderMaterial.d.ts +50 -0
- package/dist/rendering/BezierShaderMaterial.d.ts.map +1 -0
- package/dist/rendering/index.d.ts +10 -0
- package/dist/rendering/index.d.ts.map +1 -0
- package/dist/utils/Performance.d.ts +118 -0
- package/dist/utils/Performance.d.ts.map +1 -0
- package/dist/utils/featureFlags.d.ts +15 -0
- package/dist/utils/featureFlags.d.ts.map +1 -0
- package/dist/utils/hungarian.d.ts +66 -0
- package/dist/utils/hungarian.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/math.d.ts +52 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/ode.d.ts +135 -0
- package/dist/utils/ode.d.ts.map +1 -0
- package/dist/utils/skeletonize.d.ts +35 -0
- package/dist/utils/skeletonize.d.ts.map +1 -0
- package/dist/utils/triangulate.d.ts +54 -0
- package/dist/utils/triangulate.d.ts.map +1 -0
- package/dist/utils/vectors.d.ts +57 -0
- package/dist/utils/vectors.d.ts.map +1 -0
- package/package.json +122 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Vector3 type as a tuple for external API
|
|
4
|
+
*/
|
|
5
|
+
export type Vector3Tuple = [number, number, number];
|
|
6
|
+
export declare const UP: Vector3Tuple;
|
|
7
|
+
export declare const DOWN: Vector3Tuple;
|
|
8
|
+
export declare const LEFT: Vector3Tuple;
|
|
9
|
+
export declare const RIGHT: Vector3Tuple;
|
|
10
|
+
export declare const OUT: Vector3Tuple;
|
|
11
|
+
export declare const IN: Vector3Tuple;
|
|
12
|
+
export declare const ORIGIN: Vector3Tuple;
|
|
13
|
+
export declare const UL: Vector3Tuple;
|
|
14
|
+
export declare const UR: Vector3Tuple;
|
|
15
|
+
export declare const DL: Vector3Tuple;
|
|
16
|
+
export declare const DR: Vector3Tuple;
|
|
17
|
+
/**
|
|
18
|
+
* Updater function type that runs every frame
|
|
19
|
+
* @param mobject - The mobject being updated
|
|
20
|
+
* @param dt - Delta time in seconds since last frame
|
|
21
|
+
*/
|
|
22
|
+
export type UpdaterFunction = (mobject: Mobject, dt: number) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Style properties for mobjects
|
|
25
|
+
*/
|
|
26
|
+
export interface MobjectStyle {
|
|
27
|
+
fillColor?: string;
|
|
28
|
+
fillOpacity?: number;
|
|
29
|
+
strokeColor?: string;
|
|
30
|
+
strokeOpacity?: number;
|
|
31
|
+
strokeWidth?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Base mathematical object class.
|
|
35
|
+
* All visible objects in manimweb inherit from this class.
|
|
36
|
+
*/
|
|
37
|
+
export declare abstract class Mobject {
|
|
38
|
+
/** Unique identifier for this mobject */
|
|
39
|
+
readonly id: string;
|
|
40
|
+
/** Parent mobject in hierarchy */
|
|
41
|
+
parent: Mobject | null;
|
|
42
|
+
/** Child mobjects */
|
|
43
|
+
children: Mobject[];
|
|
44
|
+
/** Position in 3D space */
|
|
45
|
+
position: THREE.Vector3;
|
|
46
|
+
/** Rotation as Euler angles */
|
|
47
|
+
rotation: THREE.Euler;
|
|
48
|
+
/** Scale factors (named scaleVector to avoid conflict with scale method) */
|
|
49
|
+
scaleVector: THREE.Vector3;
|
|
50
|
+
/** Color as CSS color string (syncs stroke and fill via setter) */
|
|
51
|
+
protected _color: string;
|
|
52
|
+
get color(): string;
|
|
53
|
+
set color(value: string);
|
|
54
|
+
/** Overall opacity (0-1) - protected for backward compatibility */
|
|
55
|
+
protected _opacity: number;
|
|
56
|
+
/** Stroke width for outlines (default 4, matching Manim's thicker strokes) */
|
|
57
|
+
strokeWidth: number;
|
|
58
|
+
/** Fill opacity (0-1) */
|
|
59
|
+
fillOpacity: number;
|
|
60
|
+
/** When true, children skip the 2D z-layering offset in _syncToThree.
|
|
61
|
+
* Set this on 3D container objects (e.g. ThreeDAxes) where z-offsets
|
|
62
|
+
* would shift objects away from their intended 3D positions. */
|
|
63
|
+
protected _disableChildZLayering: boolean;
|
|
64
|
+
/** Style properties for backward compatibility */
|
|
65
|
+
protected _style: MobjectStyle;
|
|
66
|
+
/** Three.js backing object */
|
|
67
|
+
_threeObject: THREE.Object3D | null;
|
|
68
|
+
/** Dirty flag indicating transforms need sync */
|
|
69
|
+
_dirty: boolean;
|
|
70
|
+
/** Updater functions that run every frame */
|
|
71
|
+
private _updaters;
|
|
72
|
+
/**
|
|
73
|
+
* Saved mobject copy (used by Restore animation in TransformExtensions).
|
|
74
|
+
* Set by saveState().
|
|
75
|
+
*/
|
|
76
|
+
savedState: Mobject | null;
|
|
77
|
+
/**
|
|
78
|
+
* Target copy used by generateTarget() / MoveToTarget animation.
|
|
79
|
+
* Call generateTarget() to create a copy, modify targetCopy, then
|
|
80
|
+
* play MoveToTarget to interpolate from current to target state.
|
|
81
|
+
*/
|
|
82
|
+
targetCopy: Mobject | null;
|
|
83
|
+
/**
|
|
84
|
+
* JSON-serializable saved state (used by restoreState()).
|
|
85
|
+
* Set by saveState() -- typed as `unknown` here to avoid circular import;
|
|
86
|
+
* actual type is MobjectState from StateManager.ts.
|
|
87
|
+
*/
|
|
88
|
+
__savedMobjectState: unknown;
|
|
89
|
+
private static _idCounter;
|
|
90
|
+
private static _tempVec3;
|
|
91
|
+
private static _tempBox3;
|
|
92
|
+
private static _tempQuaternion;
|
|
93
|
+
constructor();
|
|
94
|
+
/**
|
|
95
|
+
* Get the overall opacity of the mobject
|
|
96
|
+
*/
|
|
97
|
+
get opacity(): number;
|
|
98
|
+
/**
|
|
99
|
+
* Set the overall opacity of the mobject
|
|
100
|
+
*/
|
|
101
|
+
set opacity(value: number);
|
|
102
|
+
/**
|
|
103
|
+
* Get the style properties
|
|
104
|
+
*/
|
|
105
|
+
get style(): MobjectStyle;
|
|
106
|
+
/**
|
|
107
|
+
* Set style properties
|
|
108
|
+
*/
|
|
109
|
+
setStyle(style: Partial<MobjectStyle>): this;
|
|
110
|
+
/**
|
|
111
|
+
* Get all submobjects (alias for children)
|
|
112
|
+
*/
|
|
113
|
+
get submobjects(): Mobject[];
|
|
114
|
+
/**
|
|
115
|
+
* Translate the mobject by a delta
|
|
116
|
+
* @param delta - Translation vector [x, y, z]
|
|
117
|
+
* @returns this for chaining
|
|
118
|
+
*/
|
|
119
|
+
shift(delta: Vector3Tuple): this;
|
|
120
|
+
/**
|
|
121
|
+
* Move the mobject to an absolute position, or align with another Mobject.
|
|
122
|
+
* @param target - Target position [x, y, z] or Mobject to align with
|
|
123
|
+
* @param alignedEdge - Optional edge direction to align (e.g., UL aligns upper-left edges)
|
|
124
|
+
* @returns this for chaining
|
|
125
|
+
*/
|
|
126
|
+
moveTo(target: Vector3Tuple | Mobject, alignedEdge?: Vector3Tuple): this;
|
|
127
|
+
/**
|
|
128
|
+
* Rotate the mobject around an axis
|
|
129
|
+
* Uses object pooling to avoid allocations in hot paths (performance optimization).
|
|
130
|
+
* @param angle - Rotation angle in radians
|
|
131
|
+
* @param axisOrOptions - Axis of rotation [x, y, z] (defaults to Z axis), or options object
|
|
132
|
+
* @returns this for chaining
|
|
133
|
+
*/
|
|
134
|
+
rotate(angle: number, axisOrOptions?: Vector3Tuple | {
|
|
135
|
+
axis?: Vector3Tuple;
|
|
136
|
+
aboutPoint?: Vector3Tuple;
|
|
137
|
+
}): this;
|
|
138
|
+
/**
|
|
139
|
+
* Rotate the mobject about the coordinate origin [0, 0, 0].
|
|
140
|
+
* @param angle - Rotation angle in radians
|
|
141
|
+
* @param axis - Axis of rotation (defaults to Z axis [0, 0, 1])
|
|
142
|
+
* @returns this for chaining
|
|
143
|
+
*/
|
|
144
|
+
rotateAboutOrigin(angle: number, axis?: Vector3Tuple): this;
|
|
145
|
+
/**
|
|
146
|
+
* Flip the mobject along an axis (mirror reflection).
|
|
147
|
+
* @param axis - Axis to flip across, defaults to RIGHT ([1,0,0]) for horizontal flip
|
|
148
|
+
* @returns this for chaining
|
|
149
|
+
*/
|
|
150
|
+
flip(axis?: Vector3Tuple): this;
|
|
151
|
+
/**
|
|
152
|
+
* Scale the mobject uniformly or non-uniformly
|
|
153
|
+
* @param factor - Scale factor (number for uniform, tuple for non-uniform)
|
|
154
|
+
* @returns this for chaining
|
|
155
|
+
*/
|
|
156
|
+
scale(factor: number | Vector3Tuple): this;
|
|
157
|
+
/**
|
|
158
|
+
* Set the mobject's color
|
|
159
|
+
* Only marks dirty if value actually changed (performance optimization).
|
|
160
|
+
* @param color - CSS color string
|
|
161
|
+
* @returns this for chaining
|
|
162
|
+
*/
|
|
163
|
+
setColor(color: string): this;
|
|
164
|
+
/**
|
|
165
|
+
* Set the mobject's overall opacity
|
|
166
|
+
* Only marks dirty if value actually changed (performance optimization).
|
|
167
|
+
* @param opacity - Opacity value (0-1)
|
|
168
|
+
* @returns this for chaining
|
|
169
|
+
*/
|
|
170
|
+
setOpacity(opacity: number): this;
|
|
171
|
+
/**
|
|
172
|
+
* Set the stroke width for outlines
|
|
173
|
+
* Only marks dirty if value actually changed (performance optimization).
|
|
174
|
+
* @param width - Stroke width in pixels
|
|
175
|
+
* @returns this for chaining
|
|
176
|
+
*/
|
|
177
|
+
setStrokeWidth(width: number): this;
|
|
178
|
+
/**
|
|
179
|
+
* Set the fill opacity
|
|
180
|
+
* Only marks dirty if value actually changed (performance optimization).
|
|
181
|
+
* @param opacity - Fill opacity (0-1)
|
|
182
|
+
* @returns this for chaining
|
|
183
|
+
*/
|
|
184
|
+
setFillOpacity(opacity: number): this;
|
|
185
|
+
/**
|
|
186
|
+
* Set the fill color and/or opacity (Manim Python parity: set_fill)
|
|
187
|
+
* @param color - CSS color string (optional)
|
|
188
|
+
* @param opacity - Fill opacity 0-1 (optional)
|
|
189
|
+
* @returns this for chaining
|
|
190
|
+
*/
|
|
191
|
+
setFill(color?: string, opacity?: number): this;
|
|
192
|
+
/**
|
|
193
|
+
* Get the fill color
|
|
194
|
+
*/
|
|
195
|
+
get fillColor(): string | undefined;
|
|
196
|
+
/**
|
|
197
|
+
* Set the fill color
|
|
198
|
+
*/
|
|
199
|
+
set fillColor(color: string);
|
|
200
|
+
/**
|
|
201
|
+
* Add a child mobject (supports multiple arguments for backward compatibility)
|
|
202
|
+
* @param mobjects - Child mobjects to add
|
|
203
|
+
* @returns this for chaining
|
|
204
|
+
*/
|
|
205
|
+
add(...mobjects: Mobject[]): this;
|
|
206
|
+
/**
|
|
207
|
+
* Remove a child mobject (supports multiple arguments for backward compatibility)
|
|
208
|
+
* @param mobjects - Child mobjects to remove
|
|
209
|
+
* @returns this for chaining
|
|
210
|
+
*/
|
|
211
|
+
remove(...mobjects: Mobject[]): this;
|
|
212
|
+
/**
|
|
213
|
+
* Create a deep copy of this mobject
|
|
214
|
+
* @returns New mobject with copied properties
|
|
215
|
+
*/
|
|
216
|
+
copy(): Mobject;
|
|
217
|
+
/**
|
|
218
|
+
* Replace this mobject's visual properties with those of another mobject.
|
|
219
|
+
* Preserves identity (updaters, scene membership) but copies appearance.
|
|
220
|
+
* @param other - The mobject to copy appearance from
|
|
221
|
+
* @returns this for chaining
|
|
222
|
+
*/
|
|
223
|
+
become(other: Mobject): this;
|
|
224
|
+
/**
|
|
225
|
+
* Scale and reposition this mobject to match another mobject's bounding box.
|
|
226
|
+
* Matches Manim Python's replace() behavior.
|
|
227
|
+
* @param target - The mobject whose bounding box to match
|
|
228
|
+
* @param stretch - If true, stretch per-axis to match exactly; if false (default), uniform scale to match width
|
|
229
|
+
* @returns this for chaining
|
|
230
|
+
*/
|
|
231
|
+
replace(target: Mobject, stretch?: boolean): this;
|
|
232
|
+
/**
|
|
233
|
+
* Create a new instance for copying. Subclasses must implement this.
|
|
234
|
+
*/
|
|
235
|
+
protected abstract _createCopy(): Mobject;
|
|
236
|
+
/**
|
|
237
|
+
* Get the center point of this mobject
|
|
238
|
+
* @returns Center position as [x, y, z]
|
|
239
|
+
*/
|
|
240
|
+
getCenter(): Vector3Tuple;
|
|
241
|
+
/**
|
|
242
|
+
* Get the bounding box of this mobject in world coordinates.
|
|
243
|
+
* @returns Object with min and max Vector3Tuple
|
|
244
|
+
*/
|
|
245
|
+
getBounds(): {
|
|
246
|
+
min: {
|
|
247
|
+
x: number;
|
|
248
|
+
y: number;
|
|
249
|
+
z: number;
|
|
250
|
+
};
|
|
251
|
+
max: {
|
|
252
|
+
x: number;
|
|
253
|
+
y: number;
|
|
254
|
+
z: number;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* Position this mobject next to another mobject
|
|
259
|
+
* @param target The mobject to position next to
|
|
260
|
+
* @param direction Direction from target (e.g., RIGHT, UP)
|
|
261
|
+
* @param buff Buffer distance between mobjects, default 0.25
|
|
262
|
+
* @returns this for chaining
|
|
263
|
+
*/
|
|
264
|
+
nextTo(target: Mobject | Vector3Tuple, direction?: Vector3Tuple, buff?: number): this;
|
|
265
|
+
/**
|
|
266
|
+
* Align this mobject with another along an edge
|
|
267
|
+
* @param target The mobject or point to align with
|
|
268
|
+
* @param direction The direction/edge to align (e.g., LEFT aligns left edges)
|
|
269
|
+
* @returns this for chaining
|
|
270
|
+
*/
|
|
271
|
+
alignTo(target: Mobject | Vector3Tuple, direction: Vector3Tuple): this;
|
|
272
|
+
/**
|
|
273
|
+
* Move this mobject to align its center with a point or mobject center
|
|
274
|
+
* @param target Target mobject or point to align with
|
|
275
|
+
* @param alignedEdge Optional edge to align instead of centers
|
|
276
|
+
* @returns this for chaining
|
|
277
|
+
*/
|
|
278
|
+
moveToAligned(target: Mobject | Vector3Tuple, alignedEdge?: Vector3Tuple): this;
|
|
279
|
+
/**
|
|
280
|
+
* Get the edge point of the bounding box in a direction
|
|
281
|
+
* @param direction Direction to get edge in
|
|
282
|
+
* @returns Edge point as [x, y, z]
|
|
283
|
+
*/
|
|
284
|
+
_getEdgeInDirection(direction: Vector3Tuple): Vector3Tuple;
|
|
285
|
+
/**
|
|
286
|
+
* Get bounding box dimensions
|
|
287
|
+
* Uses object pooling to avoid allocations in hot paths (performance optimization).
|
|
288
|
+
* @returns Object with width, height, and depth
|
|
289
|
+
*/
|
|
290
|
+
protected _getBoundingBox(): {
|
|
291
|
+
width: number;
|
|
292
|
+
height: number;
|
|
293
|
+
depth: number;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Get a specific edge point of the bounding box in a direction
|
|
297
|
+
* @param direction Direction to the edge point
|
|
298
|
+
* @returns Edge point as [x, y, z]
|
|
299
|
+
*/
|
|
300
|
+
getEdge(direction: Vector3Tuple): Vector3Tuple;
|
|
301
|
+
/**
|
|
302
|
+
* Get the top edge center
|
|
303
|
+
* @returns Top edge center as [x, y, z]
|
|
304
|
+
*/
|
|
305
|
+
getTop(): Vector3Tuple;
|
|
306
|
+
/**
|
|
307
|
+
* Get the bottom edge center
|
|
308
|
+
* @returns Bottom edge center as [x, y, z]
|
|
309
|
+
*/
|
|
310
|
+
getBottom(): Vector3Tuple;
|
|
311
|
+
/**
|
|
312
|
+
* Get the left edge center
|
|
313
|
+
* @returns Left edge center as [x, y, z]
|
|
314
|
+
*/
|
|
315
|
+
getLeft(): Vector3Tuple;
|
|
316
|
+
/**
|
|
317
|
+
* Get the right edge center
|
|
318
|
+
* @returns Right edge center as [x, y, z]
|
|
319
|
+
*/
|
|
320
|
+
getRight(): Vector3Tuple;
|
|
321
|
+
/**
|
|
322
|
+
* Set the x-coordinate of this mobject's center, preserving y and z.
|
|
323
|
+
* Matches Manim Python's set_x() behavior.
|
|
324
|
+
*/
|
|
325
|
+
setX(x: number): this;
|
|
326
|
+
/**
|
|
327
|
+
* Set the y-coordinate of this mobject's center, preserving x and z.
|
|
328
|
+
* Matches Manim Python's set_y() behavior.
|
|
329
|
+
*/
|
|
330
|
+
setY(y: number): this;
|
|
331
|
+
/**
|
|
332
|
+
* Set the z-coordinate of this mobject's center, preserving x and y.
|
|
333
|
+
* Matches Manim Python's set_z() behavior.
|
|
334
|
+
*/
|
|
335
|
+
setZ(z: number): this;
|
|
336
|
+
/**
|
|
337
|
+
* Center this mobject at origin
|
|
338
|
+
* @returns this for chaining
|
|
339
|
+
*/
|
|
340
|
+
center(): this;
|
|
341
|
+
/**
|
|
342
|
+
* Move to the edge of the frame
|
|
343
|
+
* @param direction Direction to move towards
|
|
344
|
+
* @param buff Buffer from edge
|
|
345
|
+
* @returns this for chaining
|
|
346
|
+
*/
|
|
347
|
+
toEdge(direction: Vector3Tuple, buff?: number): this;
|
|
348
|
+
/**
|
|
349
|
+
* Move to a corner of the frame
|
|
350
|
+
* @param direction Corner direction (e.g., UR for upper right)
|
|
351
|
+
* @param buff Buffer from edges
|
|
352
|
+
* @returns this for chaining
|
|
353
|
+
*/
|
|
354
|
+
toCorner(direction?: Vector3Tuple, buff?: number): this;
|
|
355
|
+
/**
|
|
356
|
+
* Sync transform properties to the Three.js object
|
|
357
|
+
*/
|
|
358
|
+
_syncToThree(): void;
|
|
359
|
+
/**
|
|
360
|
+
* Sync material-specific properties. Override in subclasses.
|
|
361
|
+
*/
|
|
362
|
+
protected _syncMaterialToThree(): void;
|
|
363
|
+
/**
|
|
364
|
+
* Mark this mobject as needing sync
|
|
365
|
+
*/
|
|
366
|
+
_markDirty(): void;
|
|
367
|
+
/**
|
|
368
|
+
* Mark this mobject and all ancestors as needing sync.
|
|
369
|
+
* Use when a deep child's geometry changes and the parent tree must re-traverse.
|
|
370
|
+
* Short-circuits if this node is already dirty (ancestors must be dirty too).
|
|
371
|
+
*/
|
|
372
|
+
_markDirtyUpward(): void;
|
|
373
|
+
/**
|
|
374
|
+
* Check if this mobject needs sync
|
|
375
|
+
*/
|
|
376
|
+
get isDirty(): boolean;
|
|
377
|
+
/**
|
|
378
|
+
* Get the Three.js object, creating it if necessary
|
|
379
|
+
*/
|
|
380
|
+
getThreeObject(): THREE.Object3D;
|
|
381
|
+
/**
|
|
382
|
+
* Create the Three.js backing object. Subclasses must implement.
|
|
383
|
+
*/
|
|
384
|
+
protected abstract _createThreeObject(): THREE.Object3D;
|
|
385
|
+
/**
|
|
386
|
+
* Apply a function to this mobject and all descendants
|
|
387
|
+
*/
|
|
388
|
+
applyToFamily(func: (mobject: Mobject) => void): this;
|
|
389
|
+
/**
|
|
390
|
+
* Get all mobjects in the family (this mobject and all descendants)
|
|
391
|
+
*/
|
|
392
|
+
getFamily(): Mobject[];
|
|
393
|
+
/**
|
|
394
|
+
* Add an updater function that runs every frame
|
|
395
|
+
* @param updater Function called with (mobject, dt) each frame
|
|
396
|
+
* @param callOnAdd Whether to call immediately, default false
|
|
397
|
+
* @returns this for chaining
|
|
398
|
+
*/
|
|
399
|
+
addUpdater(updater: UpdaterFunction, callOnAdd?: boolean): this;
|
|
400
|
+
/**
|
|
401
|
+
* Remove an updater function
|
|
402
|
+
* @param updater The updater function to remove
|
|
403
|
+
* @returns this for chaining
|
|
404
|
+
*/
|
|
405
|
+
removeUpdater(updater: UpdaterFunction): this;
|
|
406
|
+
/**
|
|
407
|
+
* Remove all updaters
|
|
408
|
+
* @returns this for chaining
|
|
409
|
+
*/
|
|
410
|
+
clearUpdaters(): this;
|
|
411
|
+
/**
|
|
412
|
+
* Check if this mobject has any updaters
|
|
413
|
+
* @returns true if the mobject has updaters
|
|
414
|
+
*/
|
|
415
|
+
hasUpdaters(): boolean;
|
|
416
|
+
/**
|
|
417
|
+
* Get all updaters (for internal use)
|
|
418
|
+
* @returns A copy of the updaters array
|
|
419
|
+
*/
|
|
420
|
+
getUpdaters(): UpdaterFunction[];
|
|
421
|
+
/**
|
|
422
|
+
* Run all updaters with given dt
|
|
423
|
+
* Called by Scene during render loop
|
|
424
|
+
* @param dt Delta time in seconds since last frame
|
|
425
|
+
*/
|
|
426
|
+
update(dt: number): void;
|
|
427
|
+
/**
|
|
428
|
+
* Apply a point-wise function to every VMobject descendant's control points.
|
|
429
|
+
* Uses duck-type check for getPoints/setPoints to avoid circular imports.
|
|
430
|
+
* @param fn - Function mapping [x, y, z] to [x', y', z']
|
|
431
|
+
* @returns this for chaining
|
|
432
|
+
*/
|
|
433
|
+
applyFunction(fn: (point: number[]) => number[]): this;
|
|
434
|
+
/**
|
|
435
|
+
* Subdivide every VMobject descendant's cubic Bezier curves so that non-linear
|
|
436
|
+
* transforms produce smooth results. Each cubic segment is split into n sub-segments
|
|
437
|
+
* via de Casteljau evaluation.
|
|
438
|
+
* @param numPieces - Number of sub-segments per original cubic segment (default 50)
|
|
439
|
+
* @returns this for chaining
|
|
440
|
+
*/
|
|
441
|
+
prepareForNonlinearTransform(numPieces?: number): this;
|
|
442
|
+
/**
|
|
443
|
+
* Create a copy of this mobject as a target for MoveToTarget animation.
|
|
444
|
+
* Modify the returned copy, then play `new MoveToTarget(this)` to
|
|
445
|
+
* smoothly interpolate from the current state to the target.
|
|
446
|
+
*
|
|
447
|
+
* @returns The target copy for modification
|
|
448
|
+
*
|
|
449
|
+
* @example
|
|
450
|
+
* ```ts
|
|
451
|
+
* mob.generateTarget();
|
|
452
|
+
* mob.targetCopy!.shift([2, 0, 0]);
|
|
453
|
+
* mob.targetCopy!.setColor('red');
|
|
454
|
+
* await scene.play(new MoveToTarget(mob));
|
|
455
|
+
* ```
|
|
456
|
+
*/
|
|
457
|
+
generateTarget(): Mobject;
|
|
458
|
+
/**
|
|
459
|
+
* Save the current state of this mobject so it can be restored later.
|
|
460
|
+
* Stores a deep copy on `this.savedState` (for Restore animation
|
|
461
|
+
* compatibility) and a serializable snapshot on `this.__savedMobjectState`
|
|
462
|
+
* (for restoreState).
|
|
463
|
+
*
|
|
464
|
+
* @returns this for chaining
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* ```ts
|
|
468
|
+
* mob.saveState();
|
|
469
|
+
* mob.shift([2, 0, 0]);
|
|
470
|
+
* mob.setColor('red');
|
|
471
|
+
* mob.restoreState(); // back to original position and color
|
|
472
|
+
* ```
|
|
473
|
+
*/
|
|
474
|
+
saveState(): this;
|
|
475
|
+
/**
|
|
476
|
+
* Restore this mobject to its previously saved state (from saveState).
|
|
477
|
+
* Uses the deep copy stored on `this.savedState` to restore all properties.
|
|
478
|
+
*
|
|
479
|
+
* @returns true if state was restored, false if no saved state exists
|
|
480
|
+
*/
|
|
481
|
+
restoreState(): boolean;
|
|
482
|
+
/**
|
|
483
|
+
* Clean up Three.js resources.
|
|
484
|
+
*/
|
|
485
|
+
dispose(): void;
|
|
486
|
+
}
|
|
487
|
+
export default Mobject;
|
|
488
|
+
//# sourceMappingURL=Mobject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mobject.d.ts","sourceRoot":"","sources":["../../src/core/Mobject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAGpD,eAAO,MAAM,EAAE,EAAE,YAAwB,CAAC;AAC1C,eAAO,MAAM,IAAI,EAAE,YAAyB,CAAC;AAC7C,eAAO,MAAM,IAAI,EAAE,YAAyB,CAAC;AAC7C,eAAO,MAAM,KAAK,EAAE,YAAwB,CAAC;AAC7C,eAAO,MAAM,GAAG,EAAE,YAAwB,CAAC;AAC3C,eAAO,MAAM,EAAE,EAAE,YAAyB,CAAC;AAC3C,eAAO,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;;;;;;;;;OAeG;IACH,SAAS,IAAI,IAAI;IAmBjB;;;;;OAKG;IACH,YAAY,IAAI,OAAO;IA4CvB;;OAEG;IACH,OAAO,IAAI,IAAI;CAmBhB;AAiBD,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Options for configuring the Renderer.
|
|
4
|
+
*/
|
|
5
|
+
export interface RendererOptions {
|
|
6
|
+
/** Canvas width in pixels. Defaults to container width. */
|
|
7
|
+
width?: number;
|
|
8
|
+
/** Canvas height in pixels. Defaults to container height. */
|
|
9
|
+
height?: number;
|
|
10
|
+
/** Background color as CSS color string. Defaults to '#000000'. */
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
/** Enable antialiasing. Defaults to true. */
|
|
13
|
+
antialias?: boolean;
|
|
14
|
+
/** Device pixel ratio. Defaults to window.devicePixelRatio (capped at 2x for performance). */
|
|
15
|
+
pixelRatio?: number;
|
|
16
|
+
/** GPU power preference. Defaults to 'high-performance'. */
|
|
17
|
+
powerPreference?: 'default' | 'high-performance' | 'low-power';
|
|
18
|
+
/** Enable alpha channel. Defaults to false. */
|
|
19
|
+
alpha?: boolean;
|
|
20
|
+
/** Preserve drawing buffer for export. Defaults to true for video/image export support. */
|
|
21
|
+
preserveDrawingBuffer?: boolean;
|
|
22
|
+
/** Existing canvas element to reuse. If not provided, a new canvas is created. */
|
|
23
|
+
canvas?: HTMLCanvasElement;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Three.js WebGLRenderer wrapper for manimweb.
|
|
27
|
+
* Handles canvas creation, rendering, and lifecycle management.
|
|
28
|
+
*/
|
|
29
|
+
export declare class Renderer {
|
|
30
|
+
private _renderer;
|
|
31
|
+
private _width;
|
|
32
|
+
private _height;
|
|
33
|
+
private _backgroundColor;
|
|
34
|
+
/**
|
|
35
|
+
* Create a new Renderer and append it to the container.
|
|
36
|
+
* @param container - DOM element to append the canvas to
|
|
37
|
+
* @param options - Renderer configuration options
|
|
38
|
+
*/
|
|
39
|
+
constructor(container: HTMLElement, options?: RendererOptions);
|
|
40
|
+
/**
|
|
41
|
+
* Get the current width.
|
|
42
|
+
*/
|
|
43
|
+
get width(): number;
|
|
44
|
+
/**
|
|
45
|
+
* Get the current height.
|
|
46
|
+
*/
|
|
47
|
+
get height(): number;
|
|
48
|
+
/**
|
|
49
|
+
* Get the background color.
|
|
50
|
+
*/
|
|
51
|
+
get backgroundColor(): THREE.Color;
|
|
52
|
+
/**
|
|
53
|
+
* Set the background color.
|
|
54
|
+
*/
|
|
55
|
+
set backgroundColor(color: THREE.Color | string);
|
|
56
|
+
/**
|
|
57
|
+
* Render a frame.
|
|
58
|
+
* @param scene - Three.js scene to render
|
|
59
|
+
* @param camera - Three.js camera to use
|
|
60
|
+
*/
|
|
61
|
+
render(scene: THREE.Scene, camera: THREE.Camera): void;
|
|
62
|
+
/**
|
|
63
|
+
* Handle resize events.
|
|
64
|
+
* @param width - New width in pixels
|
|
65
|
+
* @param height - New height in pixels
|
|
66
|
+
*/
|
|
67
|
+
resize(width: number, height: number): void;
|
|
68
|
+
/**
|
|
69
|
+
* Get the underlying canvas element.
|
|
70
|
+
* @returns The HTMLCanvasElement used for rendering
|
|
71
|
+
*/
|
|
72
|
+
getCanvas(): HTMLCanvasElement;
|
|
73
|
+
/**
|
|
74
|
+
* Get the underlying Three.js WebGLRenderer.
|
|
75
|
+
* @returns The WebGLRenderer instance
|
|
76
|
+
*/
|
|
77
|
+
getThreeRenderer(): THREE.WebGLRenderer;
|
|
78
|
+
/**
|
|
79
|
+
* Clean up resources.
|
|
80
|
+
* Removes canvas from DOM and disposes WebGL resources.
|
|
81
|
+
*/
|
|
82
|
+
dispose(): void;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=Renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Renderer.d.ts","sourceRoot":"","sources":["../../src/core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