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,86 @@
|
|
|
1
|
+
import { Surface3D, Surface3DOptions } from './Surface3D';
|
|
2
|
+
/**
|
|
3
|
+
* Options for creating a ParametricSurface
|
|
4
|
+
* (Alias for Surface3DOptions for compatibility)
|
|
5
|
+
*/
|
|
6
|
+
export type ParametricSurfaceOptions = Surface3DOptions;
|
|
7
|
+
/**
|
|
8
|
+
* ParametricSurface - Alias for Surface3D
|
|
9
|
+
*
|
|
10
|
+
* This class is provided for compatibility and naming consistency
|
|
11
|
+
* with Manim's ParametricSurface class. It is functionally identical
|
|
12
|
+
* to Surface3D.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Create a mobius strip
|
|
17
|
+
* const mobius = new ParametricSurface({
|
|
18
|
+
* func: (u, v) => {
|
|
19
|
+
* const theta = u * 2 * Math.PI;
|
|
20
|
+
* const w = 2 * v - 1;
|
|
21
|
+
* return [
|
|
22
|
+
* (1 + w / 2 * Math.cos(theta / 2)) * Math.cos(theta),
|
|
23
|
+
* (1 + w / 2 * Math.cos(theta / 2)) * Math.sin(theta),
|
|
24
|
+
* w / 2 * Math.sin(theta / 2)
|
|
25
|
+
* ];
|
|
26
|
+
* },
|
|
27
|
+
* uRange: [0, 1],
|
|
28
|
+
* vRange: [0, 1],
|
|
29
|
+
* uResolution: 64,
|
|
30
|
+
* vResolution: 16
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // Create a Klein bottle segment
|
|
34
|
+
* const klein = new ParametricSurface({
|
|
35
|
+
* func: (u, v) => {
|
|
36
|
+
* const a = 2;
|
|
37
|
+
* const theta = u * Math.PI * 2;
|
|
38
|
+
* const phi = v * Math.PI * 2;
|
|
39
|
+
* const r = a * (1 - Math.cos(theta) / 2);
|
|
40
|
+
* return [
|
|
41
|
+
* r * Math.cos(theta),
|
|
42
|
+
* r * Math.sin(theta),
|
|
43
|
+
* Math.sin(phi)
|
|
44
|
+
* ];
|
|
45
|
+
* }
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare class ParametricSurface extends Surface3D {
|
|
50
|
+
constructor(options: ParametricSurfaceOptions);
|
|
51
|
+
/**
|
|
52
|
+
* Create a copy of this ParametricSurface
|
|
53
|
+
*/
|
|
54
|
+
protected _createCopy(): ParametricSurface;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Helper function to create common parametric surfaces
|
|
58
|
+
*/
|
|
59
|
+
export declare const SurfacePresets: {
|
|
60
|
+
/**
|
|
61
|
+
* Create a sphere surface
|
|
62
|
+
*/
|
|
63
|
+
sphere(radius?: number, options?: Partial<Omit<Surface3DOptions, "func">>): ParametricSurface;
|
|
64
|
+
/**
|
|
65
|
+
* Create a torus surface
|
|
66
|
+
*/
|
|
67
|
+
torus(majorRadius?: number, minorRadius?: number, options?: Partial<Omit<Surface3DOptions, "func">>): ParametricSurface;
|
|
68
|
+
/**
|
|
69
|
+
* Create a mobius strip surface
|
|
70
|
+
*/
|
|
71
|
+
mobiusStrip(radius?: number, width?: number, options?: Partial<Omit<Surface3DOptions, "func">>): ParametricSurface;
|
|
72
|
+
/**
|
|
73
|
+
* Create a paraboloid surface
|
|
74
|
+
*/
|
|
75
|
+
paraboloid(scale?: number, options?: Partial<Omit<Surface3DOptions, "func">>): ParametricSurface;
|
|
76
|
+
/**
|
|
77
|
+
* Create a saddle surface (hyperbolic paraboloid)
|
|
78
|
+
*/
|
|
79
|
+
saddle(scale?: number, options?: Partial<Omit<Surface3DOptions, "func">>): ParametricSurface;
|
|
80
|
+
/**
|
|
81
|
+
* Create a helicoid surface
|
|
82
|
+
*/
|
|
83
|
+
helicoid(radius?: number, pitch?: number, options?: Partial<Omit<Surface3DOptions, "func">>): ParametricSurface;
|
|
84
|
+
};
|
|
85
|
+
export default ParametricSurface;
|
|
86
|
+
//# sourceMappingURL=ParametricSurface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParametricSurface.d.ts","sourceRoot":"","sources":["../../../src/mobjects/three-d/ParametricSurface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG1D;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBAAa,iBAAkB,SAAQ,SAAS;gBAClC,OAAO,EAAE,wBAAwB;IAI7C;;OAEG;cACgB,WAAW,IAAI,iBAAiB;CAcpD;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;IACzB;;OAEG;oBACY,MAAM,YAAe,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,GAAQ,iBAAiB;IAepG;;OAEG;wBACgB,MAAM,gBAAmB,MAAM,YAAiB,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,GAAQ,iBAAiB;IAenI;;OAEG;yBACiB,MAAM,UAAa,MAAM,YAAiB,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,GAAQ,iBAAiB;IAiB9H;;OAEG;uBACe,MAAM,YAAe,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,GAAQ,iBAAiB;IAWvG;;OAEG;mBACW,MAAM,YAAe,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,GAAQ,iBAAiB;IAWnG;;OAEG;sBACc,MAAM,UAAa,MAAM,YAAiB,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,GAAQ,iBAAiB;CAgB5H,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { Mobject, Vector3Tuple } from '../../core/Mobject';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
/**
|
|
4
|
+
* Base options for all polyhedra
|
|
5
|
+
*/
|
|
6
|
+
export interface PolyhedronOptions {
|
|
7
|
+
/** Side length of the polyhedron. Default: 1 */
|
|
8
|
+
sideLength?: number;
|
|
9
|
+
/** Center position [x, y, z]. Default: [0, 0, 0] */
|
|
10
|
+
center?: Vector3Tuple;
|
|
11
|
+
/** Color as CSS color string. Default: '#ffffff' */
|
|
12
|
+
color?: string;
|
|
13
|
+
/** Opacity from 0 to 1. Default: 1 */
|
|
14
|
+
opacity?: number;
|
|
15
|
+
/** Whether to render as wireframe. Default: false */
|
|
16
|
+
wireframe?: boolean;
|
|
17
|
+
/** Level of detail (subdivision level). Default: 0 */
|
|
18
|
+
detail?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Polyhedron - Base class for all platonic solids
|
|
22
|
+
*
|
|
23
|
+
* Provides common functionality for polyhedra including side length,
|
|
24
|
+
* wireframe mode, and material properties.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* // Subclasses should be used directly:
|
|
29
|
+
* const tetra = new Tetrahedron({ sideLength: 2, color: '#ff0000' });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare abstract class Polyhedron extends Mobject {
|
|
33
|
+
protected _sideLength: number;
|
|
34
|
+
protected _wireframe: boolean;
|
|
35
|
+
protected _centerPoint: Vector3Tuple;
|
|
36
|
+
protected _detail: number;
|
|
37
|
+
constructor(options?: PolyhedronOptions);
|
|
38
|
+
/**
|
|
39
|
+
* Get the radius for Three.js geometry based on side length.
|
|
40
|
+
* Subclasses override this to provide correct conversion.
|
|
41
|
+
*/
|
|
42
|
+
protected abstract _getRadiusFromSideLength(): number;
|
|
43
|
+
/**
|
|
44
|
+
* Create the Three.js geometry for this polyhedron.
|
|
45
|
+
* Subclasses must implement this.
|
|
46
|
+
*/
|
|
47
|
+
protected abstract _createGeometry(): THREE.BufferGeometry;
|
|
48
|
+
/**
|
|
49
|
+
* Create the Three.js mesh
|
|
50
|
+
*/
|
|
51
|
+
protected _createThreeObject(): THREE.Object3D;
|
|
52
|
+
/**
|
|
53
|
+
* Sync material properties to Three.js object
|
|
54
|
+
*/
|
|
55
|
+
protected _syncMaterialToThree(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Update the geometry with current dimensions
|
|
58
|
+
*/
|
|
59
|
+
protected _updateGeometry(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Get the side length
|
|
62
|
+
*/
|
|
63
|
+
getSideLength(): number;
|
|
64
|
+
/**
|
|
65
|
+
* Set the side length
|
|
66
|
+
*/
|
|
67
|
+
setSideLength(value: number): this;
|
|
68
|
+
/**
|
|
69
|
+
* Get whether wireframe mode is enabled
|
|
70
|
+
*/
|
|
71
|
+
isWireframe(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Set wireframe mode
|
|
74
|
+
*/
|
|
75
|
+
setWireframe(value: boolean): this;
|
|
76
|
+
/**
|
|
77
|
+
* Get the detail level
|
|
78
|
+
*/
|
|
79
|
+
getDetail(): number;
|
|
80
|
+
/**
|
|
81
|
+
* Set the detail level (subdivision)
|
|
82
|
+
*/
|
|
83
|
+
setDetail(value: number): this;
|
|
84
|
+
/**
|
|
85
|
+
* Get the number of faces for this polyhedron
|
|
86
|
+
*/
|
|
87
|
+
abstract getFaceCount(): number;
|
|
88
|
+
/**
|
|
89
|
+
* Get the number of vertices for this polyhedron
|
|
90
|
+
*/
|
|
91
|
+
abstract getVertexCount(): number;
|
|
92
|
+
/**
|
|
93
|
+
* Get the number of edges for this polyhedron
|
|
94
|
+
*/
|
|
95
|
+
abstract getEdgeCount(): number;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Options for creating a Tetrahedron
|
|
99
|
+
*/
|
|
100
|
+
export interface TetrahedronOptions extends PolyhedronOptions {
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Tetrahedron - A 4-faced triangular pyramid (platonic solid)
|
|
104
|
+
*
|
|
105
|
+
* Creates a tetrahedron using Three.js TetrahedronGeometry with configurable
|
|
106
|
+
* size and material properties.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* // Create a unit tetrahedron
|
|
111
|
+
* const tetra = new Tetrahedron();
|
|
112
|
+
*
|
|
113
|
+
* // Create a red tetrahedron with side length 2
|
|
114
|
+
* const redTetra = new Tetrahedron({ sideLength: 2, color: '#ff0000' });
|
|
115
|
+
*
|
|
116
|
+
* // Create a wireframe tetrahedron
|
|
117
|
+
* const wireframe = new Tetrahedron({ sideLength: 1.5, wireframe: true });
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare class Tetrahedron extends Polyhedron {
|
|
121
|
+
/**
|
|
122
|
+
* Convert side length to circumradius for Three.js TetrahedronGeometry.
|
|
123
|
+
* For a tetrahedron: circumradius = sideLength * sqrt(6) / 4
|
|
124
|
+
*/
|
|
125
|
+
protected _getRadiusFromSideLength(): number;
|
|
126
|
+
protected _createGeometry(): THREE.BufferGeometry;
|
|
127
|
+
getFaceCount(): number;
|
|
128
|
+
getVertexCount(): number;
|
|
129
|
+
getEdgeCount(): number;
|
|
130
|
+
/**
|
|
131
|
+
* Get the surface area of the tetrahedron
|
|
132
|
+
*/
|
|
133
|
+
getSurfaceArea(): number;
|
|
134
|
+
/**
|
|
135
|
+
* Get the volume of the tetrahedron
|
|
136
|
+
*/
|
|
137
|
+
getVolume(): number;
|
|
138
|
+
protected _createCopy(): Tetrahedron;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Options for creating an Octahedron
|
|
142
|
+
*/
|
|
143
|
+
export interface OctahedronOptions extends PolyhedronOptions {
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Octahedron - An 8-faced polyhedron (platonic solid)
|
|
147
|
+
*
|
|
148
|
+
* Creates an octahedron using Three.js OctahedronGeometry with configurable
|
|
149
|
+
* size and material properties. Essentially two square pyramids base-to-base.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* // Create a unit octahedron
|
|
154
|
+
* const octa = new Octahedron();
|
|
155
|
+
*
|
|
156
|
+
* // Create a blue octahedron with side length 2
|
|
157
|
+
* const blueOcta = new Octahedron({ sideLength: 2, color: '#0000ff' });
|
|
158
|
+
*
|
|
159
|
+
* // Create a semi-transparent octahedron
|
|
160
|
+
* const transparent = new Octahedron({ sideLength: 1.5, opacity: 0.5 });
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
export declare class Octahedron extends Polyhedron {
|
|
164
|
+
/**
|
|
165
|
+
* Convert side length to circumradius for Three.js OctahedronGeometry.
|
|
166
|
+
* For an octahedron: circumradius = sideLength / sqrt(2)
|
|
167
|
+
*/
|
|
168
|
+
protected _getRadiusFromSideLength(): number;
|
|
169
|
+
protected _createGeometry(): THREE.BufferGeometry;
|
|
170
|
+
getFaceCount(): number;
|
|
171
|
+
getVertexCount(): number;
|
|
172
|
+
getEdgeCount(): number;
|
|
173
|
+
/**
|
|
174
|
+
* Get the surface area of the octahedron
|
|
175
|
+
*/
|
|
176
|
+
getSurfaceArea(): number;
|
|
177
|
+
/**
|
|
178
|
+
* Get the volume of the octahedron
|
|
179
|
+
*/
|
|
180
|
+
getVolume(): number;
|
|
181
|
+
protected _createCopy(): Octahedron;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Options for creating an Icosahedron
|
|
185
|
+
*/
|
|
186
|
+
export interface IcosahedronOptions extends PolyhedronOptions {
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Icosahedron - A 20-faced polyhedron (platonic solid)
|
|
190
|
+
*
|
|
191
|
+
* Creates an icosahedron using Three.js IcosahedronGeometry with configurable
|
|
192
|
+
* size and material properties. All faces are equilateral triangles.
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```typescript
|
|
196
|
+
* // Create a unit icosahedron
|
|
197
|
+
* const icosa = new Icosahedron();
|
|
198
|
+
*
|
|
199
|
+
* // Create a green icosahedron with side length 2
|
|
200
|
+
* const greenIcosa = new Icosahedron({ sideLength: 2, color: '#00ff00' });
|
|
201
|
+
*
|
|
202
|
+
* // Create a subdivided icosahedron (closer to a sphere)
|
|
203
|
+
* const smooth = new Icosahedron({ sideLength: 1, detail: 2 });
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
export declare class Icosahedron extends Polyhedron {
|
|
207
|
+
/**
|
|
208
|
+
* Convert side length to circumradius for Three.js IcosahedronGeometry.
|
|
209
|
+
* For an icosahedron: circumradius = sideLength * sqrt(10 + 2*sqrt(5)) / 4
|
|
210
|
+
*/
|
|
211
|
+
protected _getRadiusFromSideLength(): number;
|
|
212
|
+
protected _createGeometry(): THREE.BufferGeometry;
|
|
213
|
+
getFaceCount(): number;
|
|
214
|
+
getVertexCount(): number;
|
|
215
|
+
getEdgeCount(): number;
|
|
216
|
+
/**
|
|
217
|
+
* Get the surface area of the icosahedron
|
|
218
|
+
*/
|
|
219
|
+
getSurfaceArea(): number;
|
|
220
|
+
/**
|
|
221
|
+
* Get the volume of the icosahedron
|
|
222
|
+
*/
|
|
223
|
+
getVolume(): number;
|
|
224
|
+
protected _createCopy(): Icosahedron;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Options for creating a Dodecahedron
|
|
228
|
+
*/
|
|
229
|
+
export interface DodecahedronOptions extends PolyhedronOptions {
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Dodecahedron - A 12-faced polyhedron (platonic solid)
|
|
233
|
+
*
|
|
234
|
+
* Creates a dodecahedron using Three.js DodecahedronGeometry with configurable
|
|
235
|
+
* size and material properties. All faces are regular pentagons.
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```typescript
|
|
239
|
+
* // Create a unit dodecahedron
|
|
240
|
+
* const dodeca = new Dodecahedron();
|
|
241
|
+
*
|
|
242
|
+
* // Create a purple dodecahedron with side length 2
|
|
243
|
+
* const purpleDodeca = new Dodecahedron({ sideLength: 2, color: '#800080' });
|
|
244
|
+
*
|
|
245
|
+
* // Create a wireframe dodecahedron
|
|
246
|
+
* const wireframe = new Dodecahedron({ sideLength: 1.5, wireframe: true });
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
export declare class Dodecahedron extends Polyhedron {
|
|
250
|
+
/**
|
|
251
|
+
* Convert side length to circumradius for Three.js DodecahedronGeometry.
|
|
252
|
+
* For a dodecahedron: circumradius = sideLength * phi * sqrt(3) / 2
|
|
253
|
+
* where phi = (1 + sqrt(5)) / 2 (golden ratio)
|
|
254
|
+
*/
|
|
255
|
+
protected _getRadiusFromSideLength(): number;
|
|
256
|
+
protected _createGeometry(): THREE.BufferGeometry;
|
|
257
|
+
getFaceCount(): number;
|
|
258
|
+
getVertexCount(): number;
|
|
259
|
+
getEdgeCount(): number;
|
|
260
|
+
/**
|
|
261
|
+
* Get the surface area of the dodecahedron
|
|
262
|
+
*/
|
|
263
|
+
getSurfaceArea(): number;
|
|
264
|
+
/**
|
|
265
|
+
* Get the volume of the dodecahedron
|
|
266
|
+
*/
|
|
267
|
+
getVolume(): number;
|
|
268
|
+
protected _createCopy(): Dodecahedron;
|
|
269
|
+
}
|
|
270
|
+
export default Polyhedron;
|
|
271
|
+
//# sourceMappingURL=Polyhedra.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Polyhedra.d.ts","sourceRoot":"","sources":["../../../src/mobjects/three-d/Polyhedra.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,OAAO,C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UAAU;IAC1C;;;;OAIG;IACH,SAAS,CAAC,wBAAwB,IAAI,MAAM;IAK5C,SAAS,CAAC,eAAe,IAAI,KAAK,CAAC,cAAc;IAKjD,YAAY,IAAI,MAAM;IAItB,cAAc,IAAI,MAAM;IAIxB,YAAY,IAAI,MAAM;IAItB;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACH,SAAS,IAAI,MAAM;cAIA,WAAW,IAAI,YAAY;CAU/C;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Mobject, Vector3Tuple } from '../../core/Mobject';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
/**
|
|
4
|
+
* Options for creating a Sphere
|
|
5
|
+
*/
|
|
6
|
+
export interface SphereOptions {
|
|
7
|
+
/** Radius of the sphere. Default: 1 */
|
|
8
|
+
radius?: number;
|
|
9
|
+
/** Center position [x, y, z]. Default: [0, 0, 0] */
|
|
10
|
+
center?: Vector3Tuple;
|
|
11
|
+
/** Color as CSS color string. Default: '#ffffff' */
|
|
12
|
+
color?: string;
|
|
13
|
+
/** Opacity from 0 to 1. Default: 1 */
|
|
14
|
+
opacity?: number;
|
|
15
|
+
/** Number of segments for sphere geometry. Default: 32 */
|
|
16
|
+
resolution?: number;
|
|
17
|
+
/** Whether to render as wireframe. Default: false */
|
|
18
|
+
wireframe?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Sphere - A 3D spherical mesh
|
|
22
|
+
*
|
|
23
|
+
* Creates a sphere using Three.js SphereGeometry with configurable
|
|
24
|
+
* radius, resolution, and material properties.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* // Create a unit sphere
|
|
29
|
+
* const sphere = new Sphere();
|
|
30
|
+
*
|
|
31
|
+
* // Create a red sphere with radius 2
|
|
32
|
+
* const redSphere = new Sphere({ radius: 2, color: '#ff0000' });
|
|
33
|
+
*
|
|
34
|
+
* // Create a semi-transparent wireframe sphere
|
|
35
|
+
* const wireframe = new Sphere({
|
|
36
|
+
* radius: 1.5,
|
|
37
|
+
* wireframe: true,
|
|
38
|
+
* opacity: 0.7
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare class Sphere extends Mobject {
|
|
43
|
+
private _radius;
|
|
44
|
+
private _resolution;
|
|
45
|
+
private _wireframe;
|
|
46
|
+
private _centerPoint;
|
|
47
|
+
constructor(options?: SphereOptions);
|
|
48
|
+
/**
|
|
49
|
+
* Create the Three.js sphere mesh
|
|
50
|
+
*/
|
|
51
|
+
protected _createThreeObject(): THREE.Object3D;
|
|
52
|
+
/**
|
|
53
|
+
* Sync material properties to Three.js object
|
|
54
|
+
*/
|
|
55
|
+
protected _syncMaterialToThree(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Get the radius
|
|
58
|
+
*/
|
|
59
|
+
getRadius(): number;
|
|
60
|
+
/**
|
|
61
|
+
* Set the radius
|
|
62
|
+
*/
|
|
63
|
+
setRadius(value: number): this;
|
|
64
|
+
/**
|
|
65
|
+
* Get the resolution (number of segments)
|
|
66
|
+
*/
|
|
67
|
+
getResolution(): number;
|
|
68
|
+
/**
|
|
69
|
+
* Set the resolution
|
|
70
|
+
*/
|
|
71
|
+
setResolution(value: number): this;
|
|
72
|
+
/**
|
|
73
|
+
* Get whether wireframe mode is enabled
|
|
74
|
+
*/
|
|
75
|
+
isWireframe(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Set wireframe mode
|
|
78
|
+
*/
|
|
79
|
+
setWireframe(value: boolean): this;
|
|
80
|
+
/**
|
|
81
|
+
* Get the surface area of the sphere
|
|
82
|
+
*/
|
|
83
|
+
getSurfaceArea(): number;
|
|
84
|
+
/**
|
|
85
|
+
* Get the volume of the sphere
|
|
86
|
+
*/
|
|
87
|
+
getVolume(): number;
|
|
88
|
+
/**
|
|
89
|
+
* Get a point on the sphere at given spherical coordinates
|
|
90
|
+
* @param theta Azimuthal angle (0 to 2*PI)
|
|
91
|
+
* @param phi Polar angle (0 to PI)
|
|
92
|
+
*/
|
|
93
|
+
pointAtAngles(theta: number, phi: number): Vector3Tuple;
|
|
94
|
+
/**
|
|
95
|
+
* Create a copy of this Sphere
|
|
96
|
+
*/
|
|
97
|
+
protected _createCopy(): Sphere;
|
|
98
|
+
}
|
|
99
|
+
export default Sphere;
|
|
100
|
+
//# sourceMappingURL=Sphere.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sphere.d.ts","sourceRoot":"","sources":["../../../src/mobjects/three-d/Sphere.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,MAAO,SAAQ,OAAO;IACjC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,UAAU,CAAU;IAC5B,OAAO,CAAC,YAAY,CAAe;gBAEvB,OAAO,GAAE,aAAkB;IAyBvC;;OAEG;IACH,SAAS,CAAC,kBAAkB,IAAI,KAAK,CAAC,QAAQ;IAmB9C;;OAEG;cACgB,oBAAoB,IAAI,IAAI;IAa/C;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAe9B;;OAEG;IACH,aAAa,IAAI,MAAM;IAIvB;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAclC;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAMlC;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;;;OAIG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY;IAWvD;;OAEG;cACgB,WAAW,IAAI,MAAM;CAUzC;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Mobject, Vector3Tuple } from '../../core/Mobject';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
/**
|
|
4
|
+
* Options for creating a Surface3D
|
|
5
|
+
*/
|
|
6
|
+
export interface Surface3DOptions {
|
|
7
|
+
/** Parametric function (u, v) => [x, y, z] */
|
|
8
|
+
func: (u: number, v: number) => Vector3Tuple;
|
|
9
|
+
/** U parameter range [min, max]. Default: [0, 1] */
|
|
10
|
+
uRange?: [number, number];
|
|
11
|
+
/** V parameter range [min, max]. Default: [0, 1] */
|
|
12
|
+
vRange?: [number, number];
|
|
13
|
+
/** Number of segments in U direction. Default: 32 */
|
|
14
|
+
uResolution?: number;
|
|
15
|
+
/** Number of segments in V direction. Default: 32 */
|
|
16
|
+
vResolution?: number;
|
|
17
|
+
/** Center position [x, y, z]. Default: [0, 0, 0] */
|
|
18
|
+
center?: Vector3Tuple;
|
|
19
|
+
/** Color as CSS color string. Default: '#ffffff' */
|
|
20
|
+
color?: string;
|
|
21
|
+
/** Opacity from 0 to 1. Default: 1 */
|
|
22
|
+
opacity?: number;
|
|
23
|
+
/** Whether to render as wireframe. Default: false */
|
|
24
|
+
wireframe?: boolean;
|
|
25
|
+
/** Whether to render both sides. Default: true */
|
|
26
|
+
doubleSided?: boolean;
|
|
27
|
+
/** Two alternating colors for a checkerboard pattern on the surface, e.g. ['#E65A4C', '#CF5044']. */
|
|
28
|
+
checkerboardColors?: [string, string];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Surface3D - A parametric 3D surface
|
|
32
|
+
*
|
|
33
|
+
* Creates a parametric surface using Three.js ParametricGeometry.
|
|
34
|
+
* The surface is defined by a function that maps (u, v) parameters
|
|
35
|
+
* to 3D points.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* // Create a paraboloid
|
|
40
|
+
* const paraboloid = new Surface3D({
|
|
41
|
+
* func: (u, v) => {
|
|
42
|
+
* const x = u * 2 - 1;
|
|
43
|
+
* const y = v * 2 - 1;
|
|
44
|
+
* const z = x * x + y * y;
|
|
45
|
+
* return [x, y, z];
|
|
46
|
+
* },
|
|
47
|
+
* uRange: [0, 1],
|
|
48
|
+
* vRange: [0, 1]
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* // Create a sphere using parametric equations
|
|
52
|
+
* const sphere = new Surface3D({
|
|
53
|
+
* func: (u, v) => {
|
|
54
|
+
* const theta = u * Math.PI * 2;
|
|
55
|
+
* const phi = v * Math.PI;
|
|
56
|
+
* return [
|
|
57
|
+
* Math.sin(phi) * Math.cos(theta),
|
|
58
|
+
* Math.sin(phi) * Math.sin(theta),
|
|
59
|
+
* Math.cos(phi)
|
|
60
|
+
* ];
|
|
61
|
+
* }
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare class Surface3D extends Mobject {
|
|
66
|
+
protected _func: (u: number, v: number) => Vector3Tuple;
|
|
67
|
+
protected _uRange: [number, number];
|
|
68
|
+
protected _vRange: [number, number];
|
|
69
|
+
protected _uResolution: number;
|
|
70
|
+
protected _vResolution: number;
|
|
71
|
+
protected _wireframe: boolean;
|
|
72
|
+
protected _doubleSided: boolean;
|
|
73
|
+
protected _centerPoint: Vector3Tuple;
|
|
74
|
+
protected _checkerboardColors?: [string, string];
|
|
75
|
+
constructor(options: Surface3DOptions);
|
|
76
|
+
/**
|
|
77
|
+
* Create the Three.js parametric surface mesh
|
|
78
|
+
*/
|
|
79
|
+
protected _createThreeObject(): THREE.Object3D;
|
|
80
|
+
/**
|
|
81
|
+
* Sync material properties to Three.js object
|
|
82
|
+
*/
|
|
83
|
+
protected _syncMaterialToThree(): void;
|
|
84
|
+
/**
|
|
85
|
+
* Update the geometry with current function and parameters
|
|
86
|
+
*/
|
|
87
|
+
protected _updateGeometry(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Get the parametric function
|
|
90
|
+
*/
|
|
91
|
+
getFunc(): (u: number, v: number) => Vector3Tuple;
|
|
92
|
+
/**
|
|
93
|
+
* Set the parametric function
|
|
94
|
+
*/
|
|
95
|
+
setFunc(func: (u: number, v: number) => Vector3Tuple): this;
|
|
96
|
+
/**
|
|
97
|
+
* Get the U parameter range
|
|
98
|
+
*/
|
|
99
|
+
getURange(): [number, number];
|
|
100
|
+
/**
|
|
101
|
+
* Set the U parameter range
|
|
102
|
+
*/
|
|
103
|
+
setURange(range: [number, number]): this;
|
|
104
|
+
/**
|
|
105
|
+
* Get the V parameter range
|
|
106
|
+
*/
|
|
107
|
+
getVRange(): [number, number];
|
|
108
|
+
/**
|
|
109
|
+
* Set the V parameter range
|
|
110
|
+
*/
|
|
111
|
+
setVRange(range: [number, number]): this;
|
|
112
|
+
/**
|
|
113
|
+
* Get the U resolution
|
|
114
|
+
*/
|
|
115
|
+
getUResolution(): number;
|
|
116
|
+
/**
|
|
117
|
+
* Set the U resolution
|
|
118
|
+
*/
|
|
119
|
+
setUResolution(value: number): this;
|
|
120
|
+
/**
|
|
121
|
+
* Get the V resolution
|
|
122
|
+
*/
|
|
123
|
+
getVResolution(): number;
|
|
124
|
+
/**
|
|
125
|
+
* Set the V resolution
|
|
126
|
+
*/
|
|
127
|
+
setVResolution(value: number): this;
|
|
128
|
+
/**
|
|
129
|
+
* Get whether wireframe mode is enabled
|
|
130
|
+
*/
|
|
131
|
+
isWireframe(): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Set wireframe mode
|
|
134
|
+
*/
|
|
135
|
+
setWireframe(value: boolean): this;
|
|
136
|
+
/**
|
|
137
|
+
* Get whether double-sided rendering is enabled
|
|
138
|
+
*/
|
|
139
|
+
isDoubleSided(): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Set double-sided rendering
|
|
142
|
+
*/
|
|
143
|
+
setDoubleSided(value: boolean): this;
|
|
144
|
+
/**
|
|
145
|
+
* Evaluate the surface at given parameters
|
|
146
|
+
* @param u U parameter
|
|
147
|
+
* @param v V parameter
|
|
148
|
+
*/
|
|
149
|
+
evaluate(u: number, v: number): Vector3Tuple;
|
|
150
|
+
/**
|
|
151
|
+
* Create a copy of this Surface3D
|
|
152
|
+
*/
|
|
153
|
+
protected _createCopy(): Surface3D;
|
|
154
|
+
}
|
|
155
|
+
export default Surface3D;
|
|
156
|
+
//# sourceMappingURL=Surface3D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Surface3D.d.ts","sourceRoot":"","sources":["../../../src/mobjects/three-d/Surface3D.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,YAAY,CAAC;IAC7C,oDAAoD;IACpD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,oDAAoD;IACpD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;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