Exemplo n.º 1
0
def derived_loft():
    w1 = cm.wire([cm.circle(1.0)])
    w2 = cm.wire([cm.circle(2.0)])
    w2.translate((0.0, 0.0, 5.0))
    w3 = cm.wire([cm.circle(1.5)])
    w3.translate((0.0, 0.0, 10.0))
    s1 = cm.loft([w1, w2, w3])
    save_iso(s1, 'derived_loft.png')
Exemplo n.º 2
0
def derived_loft():
    w1 = cm.wire([cm.circle(1.0)])
    w2 = cm.wire([cm.circle(2.0)])
    w2.translate((0.0, 0.0, 5.0))
    w3 = cm.wire([cm.circle(1.5)])
    w3.translate((0.0, 0.0, 10.0))
    s1 = cm.loft([w1, w2, w3])
    save_iso(s1, 'derived_loft.png')
Exemplo n.º 3
0
 def test_loft(self):
     w1 = cm.Wire([cm.circle(1.0)])
     w2 = cm.Wire([cm.circle(2.0)])
     w2.translate((0.0, 0.0, 5.0))
     w3 = cm.Wire([cm.circle(1.5)])
     w3.translate((0.0, 0.0, 10.0))
     s1 = cm.loft([w1, w2, w3])
     # empirical
     self.assert_(close(98.407, s1.volume(), 0.001))
Exemplo n.º 4
0
 def test_loft(self):
     w1 = cm.wire([cm.circle(1.0)])
     w2 = cm.wire([cm.circle(2.0)])
     w2.translate((0.0, 0.0, 5.0))
     w3 = cm.wire([cm.circle(1.5)])
     w3.translate((0.0, 0.0, 10.0))
     s1 = cm.loft([w1, w2, w3])
     # empirical
     self.assert_(close(98.407, s1.volume(), 0.001))
Exemplo n.º 5
0
 def test_copy(self):
     s1 = cm.circle(1.0)
     s2 = s1.copy()
     s1.translate((1.0, 1.0, 1.0))
     self.assert_(
         close(s2.center(), (0.0, 0.0, 0.0))
         and close(s1.center(), (1.0, 1.0, 1.0)))
Exemplo n.º 6
0
 def test_to_iges(self):
     s1 = cm.circle(1.0)
     r1 = s1.length()
     s1.to_iges('tmp.igs', brep_mode=1)
     s2 = cm.from_iges('tmp.igs')
     r2 = s2.length()
     self.assert_(close(r1, 2 * math.pi) and close(r2, 2 * math.pi))
Exemplo n.º 7
0
 def test_to_brep(self):
     s1 = cm.circle(1.0)
     r1 = s1.length()
     s1.to_brep('tmp.brp')
     s2 = cm.from_brep('tmp.brp')
     r2 = s2.length()
     self.assert_(close(r1, 2 * math.pi) and close(r2, 2 * math.pi))
Exemplo n.º 8
0
 def test_to_iges(self):
     s1 = cm.circle(1.0)
     r1 = s1.length()
     s1.to_iges('tmp.igs', brep_mode=1)
     s2 = cm.from_iges('tmp.igs')
     r2 = s2.length()
     self.assert_(close(r1, 2 * math.pi) and
                  close(r2, 2 * math.pi))
Exemplo n.º 9
0
 def test_to_brep(self):
     s1 = cm.circle(1.0)
     r1 = s1.length()
     s1.to_brep('tmp.brp')
     s2 = cm.from_brep('tmp.brp')
     r2 = s2.length()
     self.assert_(close(r1, 2 * math.pi) and
                  close(r2, 2 * math.pi))
Exemplo n.º 10
0
 def test_circle(self):
     e1 = cm.circle(3.0)
     self.assert_(close(3 * 2 * math.pi, e1.length()))
Exemplo n.º 11
0
def edge_circle():
    e1 = cm.circle(3.0)
    save_top(e1, 'edge_circle.png', (0.0, 0.0, 0.0))
Exemplo n.º 12
0
def edge_circle():
    e1 = cm.circle(3.0)
    save_top(e1, 'edge_circle.png', (0.0, 0.0, 0.0))
Exemplo n.º 13
0
 def test_copy(self):
     s1 = cm.circle(1.0)
     s2 = s1.copy()
     s1.translate((1.0, 1.0, 1.0))
     self.assert_(close(s2.center(), (0.0, 0.0, 0.0)) and
                  close(s1.center(), (1.0, 1.0, 1.0)))
Exemplo n.º 14
0
 def test_circle(self):
     e1 = cm.circle(3.0)
     self.assert_(close(3 * 2 * math.pi, e1.length()))
Exemplo n.º 15
0
 def test_bounds(self):
     s1 = cm.circle(1.0)
     self.assert_(
         close(s1.bounds(), (-1.0, -1.0, 0.0, 1.0, 1.0, 0.0), eps=0.1))
Exemplo n.º 16
0
 def test_center(self):
     s1 = cm.circle(1.0)
     s1.translate((1.0, 2.0, 3.0))
     self.assert_(close(s1.center(), (1.0, 2.0, 3.0)))
Exemplo n.º 17
0
 def test_bounds(self):
     s1 = cm.circle(1.0)
     self.assert_(close(s1.bounds(),
                        (-1.0, -1.0, 0.0, 1.0, 1.0, 0.0), eps=0.1))
Exemplo n.º 18
0
 def test_center(self):
     s1 = cm.circle(1.0)
     s1.translate((1.0, 2.0, 3.0))
     self.assert_(close(s1.center(), (1.0, 2.0, 3.0)))
Exemplo n.º 19
0
 def draw(self, view):
     self.geom = model.circle(self.r.val)
     self.geom.translate([self.p.x.val, self.p.y.val, 0])
     view.display(self.geom)