Ejemplo n.º 1
0
 def test_extrude(self):
     sketch = Sketch("extrude_sketch.s")
     sketch.add_curve_segment(sketch.circle((0, 1), (0, 0)))
     self.brl_db.save(sketch)
     shape = sketch.extrude("extrude.s")
     self.brl_db.save(shape)
     result = self.brl_db.lookup(shape.name)
     self.assertTrue(shape.is_same(result))
     self.assertTrue(sketch.is_same(result.sketch))
Ejemplo n.º 2
0
 def test_extrude(self):
     sketch = Sketch("extrude_sketch.s")
     sketch.add_curve_segment(sketch.circle((0, 1), (0, 0)))
     self.brl_db.save(sketch)
     shape = sketch.extrude("extrude.s")
     self.brl_db.save(shape)
     result = self.brl_db.lookup(shape.name)
     self.assertTrue(shape.is_same(result))
     self.assertTrue(sketch.is_same(result.sketch))
Ejemplo n.º 3
0
 def test_example_sketch(self):
     sketch = Sketch("example.s", u_vec=(0, 1, 0), v_vec=(0, 0, 1))
     sketch.add_curve_segment(sketch.circle((0.5, 0), (0, 0)))
     sketch.add_curve_segment(sketch.line((-1, -1), (-1, 1)))
     sketch.add_curve_segment(sketch.line((-1, 1), (1, 1)))
     sketch.add_curve_segment(sketch.line((1, 1), (1, -1)))
     sketch.add_curve_segment(sketch.line((1, -1), (-1, -1)))
     sketch.add_curve_segment(
         sketch.bezier(((-2, 0), (-2, 6), (0, -4), (2, 6), (2, 0))))
     sketch.add_curve_segment(
         sketch.nurb([(-2, 0), (-2, -3), (0, -1), (2, -3), (2, 0)],
                     order=4,
                     reverse=True), )
     self.brl_db.save(sketch)
     result = self.brl_db.lookup(sketch.name)
     self.assertTrue(sketch.is_same(result))
Ejemplo n.º 4
0
 def test_example_sketch(self):
     sketch = Sketch("example.s", u_vec=(0, 1, 0), v_vec=(0, 0, 1))
     sketch.add_curve_segment(sketch.circle((0.5, 0), (0, 0)))
     sketch.add_curve_segment(sketch.line((-1, -1), (-1, 1)))
     sketch.add_curve_segment(sketch.line((-1, 1), (1, 1)))
     sketch.add_curve_segment(sketch.line((1, 1), (1, -1)))
     sketch.add_curve_segment(sketch.line((1, -1), (-1, -1)))
     sketch.add_curve_segment(
         sketch.bezier((
             (-2, 0), (-2, 6), (0, -4), (2, 6), (2, 0)
         ))
     )
     sketch.add_curve_segment(
         sketch.nurb(
             [(-2, 0), (-2, -3), (0, -1), (2, -3), (2, 0)],
             order=4,
             reverse=True
         ),
     )
     self.brl_db.save(sketch)
     result = self.brl_db.lookup(sketch.name)
     self.assertTrue(sketch.is_same(result))