Skip to content

Commit

Permalink
update DoubleArrow3D
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmmedHesham authored Apr 26, 2024
1 parent 759a624 commit 04691cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Mobjects/Mobjects.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from manim import *

class DoubleArrow3D(Line3D):
def __init__(
self,
Expand All @@ -8,29 +7,31 @@ def __init__(
thickness: float = 0.02,
height: float = 0.3,
base_radius: float = 0.08,

color: ParsableManimColor = WHITE,
**kwargs,
) -> None:
super().__init__(
start=start, end=end, thickness=thickness, color=color, **kwargs
start=start, end=end, thickness=thickness, color=color, **kwargs,
)

self.length = np.linalg.norm(self.vect)

self.set_start_and_end_attrs(
self.start - height * -self.direction,
self.end - height * self.direction,
self.start - (height+0.1) * -self.direction,
self.end - (height+0.1) * self.direction,
**kwargs,
)

self.cone = Cone(
direction=self.direction, base_radius=base_radius, height=height, **kwargs
)
self.cone2 = Cone(
direction=-self.direction, base_radius=base_radius, height=height, **kwargs

)
self.cone.shift(end)
self.cone2.shift(start)
self.cone.shift(self.end + (height-0.2) * self.direction)
self.cone2.shift(self.start + (height-0.2) * -self.direction)
self.add(self.cone, self.cone2)
self.set_color(color)


7 changes: 7 additions & 0 deletions src/notebook/processism_OOP.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
"from AnimationManger import * "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit 04691cd

Please # to comment.