Ejemplo n.º 1
0
 def test_scene_addition(self):
     from clifford.tools.g3c import random_line, random_circle
     a = GanjaScene()
     a.add_objects([random_line() for i in range(10)], color=Color.RED)
     b = GanjaScene()
     b.add_objects([random_circle() for i in range(10)], color=Color.BLUE)
     draw(a + b, scale=0.01)
Ejemplo n.º 2
0
    def test_draw_lines(self):
        def random_line():
            return (self.random_point().dual()
                    ^ self.random_point().dual()).dual()

        gs = GanjaScene()
        gs.add_objects([random_line() for i in range(10)], static=False)
        with open('test_file.html', 'w') as test_file:
            test_file.write(
                generate_full_html(str(gs),
                                   sig=self.layout.sig,
                                   grid=True,
                                   scale=1.0,
                                   gl=True))
        draw(gs, sig=self.layout.sig, grid=True, scale=1.0, gl=True)
Ejemplo n.º 3
0
 def test_print_scene(self):
     from clifford.tools.g3c import random_line
     gs = GanjaScene()
     gs.add_objects([random_line() for i in range(2)])
     print(gs)
Ejemplo n.º 4
0
 def test_draw_lines(self):
     from clifford.tools.g3c import random_line
     draw([random_line() for i in range(10)], static=True, color=Color.RED)