diff --git a/README.md b/README.md index 863664c..1d670ec 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Multiple other examples can be found in the `tests/test_scene.py` file. [![see the PyramidScene for basic manim mesh uses](docs/images/PyramidScene.png)](https://user-images.githubusercontent.com/1500595/193240449-5978f46f-68b0-4d08-bf37-4ff1fea54f28.mp4) The general procedure is like in manim, create a class with a construct method. Then create and add the instance of the renderable mesh you like to use. This mesh will receive the real node-face mesh and manipulate it. -You can shift (translate), rotate, scale the whole mesh or single vertices. Additionally most of the manim functions are available as coloring single objects. +You can shift (translate) and scale the whole mesh or single vertices. Additionally most of the manim functions are available as coloring single objects. Somehow Rotate does not work, because it only updates the copy of the rotation and therefore our own mesh class does not get updated. ### Parameters As parameters got a little overwhelming, there are a few default parameters for the meshes in `params.py`. You just need to pass kwargs that you want to change while creating the mesh. diff --git a/pyproject.toml b/pyproject.toml index 559ad66..7664e2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "manim-meshes" -version = "0.0.7-alpha.1" +version = "0.0.7" description = "rendering 2D and 3D Meshes with manim for displaying and educational Purposes." readme = "README.md" authors = ["Brizar ", "99Vicky"] diff --git a/tests/test_scene.py b/tests/test_scene.py index 8ac5631..32572eb 100644 --- a/tests/test_scene.py +++ b/tests/test_scene.py @@ -1,16 +1,14 @@ """ create a few sample test scenes to check efficiency of renderer """ -from copy import deepcopy - # pylint: skip-file # pylint: disable-all - +# python imports +from copy import deepcopy # third-party imports import manim as m -# local imports import numpy as np - +# local imports from manim_meshes.delaunay.delaunay_criterion import get_point_indices_violating_delaunay, is_point_violating_delaunay, \ get_circum_circle from manim_meshes.delaunay.divide_and_conquer import DivideAndConquer @@ -88,16 +86,16 @@ class PyramidScene(m.ThreeDScene): def construct(self): self.set_camera_orientation(70 * m.DEGREES, 30 * m.DEGREES) # pyramid with only triangles - manim_triangle_pyramid = ManimMesh(mesh=deepcopy(create_pyramid(triangles_only=True)), display_vertices=True, name="Tri Mesh") + manim_triangle_pyramid = ManimMesh(mesh=create_pyramid(triangles_only=True), display_vertices=True, name="Tri Mesh") manim_triangle_pyramid.shift(m.OUT) self.add(manim_triangle_pyramid) # pyramid with triangles and a quad bottom to test the renderer - manim_quad_pyramid = ManimMesh(mesh=deepcopy(create_pyramid(triangles_only=False)), display_vertices=True, name="Quad Mesh") + manim_quad_pyramid = ManimMesh(mesh=create_pyramid(triangles_only=False), display_vertices=True, name="Quad Mesh") manim_quad_pyramid.shift(m.IN, m.IN) self.add(manim_quad_pyramid) self.play( - m.Rotate(manim_triangle_pyramid, angle=2 * m.PI, about_point=m.ORIGIN, run_time=2.0), - m.Rotate(manim_quad_pyramid, angle=2 * m.PI, about_point=m.ORIGIN, run_time=2.0), + m.Rotate(manim_triangle_pyramid, angle=m.PI, about_point=m.ORIGIN, run_time=2.0), + m.Rotate(manim_quad_pyramid, angle=m.PI, about_point=m.ORIGIN, run_time=2.0), ) # ATTENTION: default animation m.Rotate does not work (yet) properly with our implementation # currently you have to call .mesh.apply_rotation with the same parameters after the m.Rotate is played @@ -112,8 +110,8 @@ def construct(self): manim_triangle_pyramid.move_vertex_to(vertex_idx=0, scene=self, pos=np.array([2, 2, 1])), manim_quad_pyramid.move_vertex_to(vertex_idx=1, scene=self, pos=np.array([2, -1.5, -1.5])), self.play( - m.Rotate(manim_triangle_pyramid, angle=2 * m.PI, about_point=m.ORIGIN, run_time=2.0), - m.Rotate(manim_quad_pyramid, angle=2 * m.PI, about_point=m.ORIGIN, run_time=2.0), + m.Rotate(manim_triangle_pyramid, angle=m.PI, about_point=m.ORIGIN, run_time=2.0), + m.Rotate(manim_quad_pyramid, angle=m.PI, about_point=m.ORIGIN, run_time=2.0), ) # ATTENTION, see above manim_triangle_pyramid.mesh.apply_rotation(angle=2 * m.PI, about_point=m.ORIGIN) @@ -293,8 +291,8 @@ def construct(self): ) self.add(grid_mesh) # generate "random" points and define their color for later - p1 = [0.2, 0.1]; - p2 = [0.5, 0.65]; + p1 = [0.2, 0.1] + p2 = [0.5, 0.65] p3 = [-1.2, 0.4] other_vertices = np.array([[1, 1], [-1, 1.1], [-1.5, -1.4], [1.6, 1.7], [1.1, 1.5], [-0.15, -0.75], [-0.15, 0.05], [-0.15, -1.15], [0.15, -1.15], [1.5, -1.5], [-0.95, 0.4]])