Ejemplo n.º 1
0
 def test_filling(self):
     e1 = cm.spline([(0.0, 0.0, 0.0), (1.0, 0.2, 0.3), (1.5, 0.8, 1.0),
                     (0.8, 1.2, 0.2), (0.0, 1.0, 0.0)])
     e2 = cm.spline([(0.0, 0.0, 0.0), (-1.0, 0.2, 0.3), (-1.5, 0.8, 1.0),
                     (-0.8, 1.2, 0.2), (0.0, 1.0, 0.0)])
     w1 = cm.wire([e1, e2])
     f1 = cm.filling(w1)
     # empirical
     self.assert_(close(5.479, f1.area(), 0.01))  # Can vary
Ejemplo n.º 2
0
 def test_filling(self):
     e1 = cm.spline([(0.0, 0.0, 0.0), (1.0, 0.2, 0.3), (1.5, 0.8, 1.0),
                     (0.8, 1.2, 0.2), (0.0, 1.0, 0.0)])
     e2 = cm.spline([(0.0, 0.0, 0.0), (-1.0, 0.2, 0.3), (-1.5, 0.8, 1.0),
                     (-0.8, 1.2, 0.2), (0.0, 1.0, 0.0)])
     w1 = cm.Wire([e1, e2])
     f1 = cm.filling(w1)
     # empirical
     # Can vary considerably given the spline nature
     # self.assert_(close(5.479, f1.area(), 0.01))
     self.assert_(close(5.44100168973, f1.area(), 0.01))
Ejemplo n.º 3
0
def face_filling():
    e1 = cm.spline([(0.0, 0.0, 0.0), (1.0, 0.2, 0.3), (1.5, 0.8, 1.0),
                    (0.8, 1.2, 0.2), (0.0, 1.0, 0.0)])
    e2 = cm.spline([(0.0, 0.0, 0.0), (-1.0, 0.2, 0.3), (-1.5, 0.8, 1.0),
                    (-0.8, 1.2, 0.2), (0.0, 1.0, 0.0)])
    w1 = cm.wire([e1, e2])
    f1 = cm.filling(w1)
    v.viewstandard(viewtype='iso')
    v.display(w1, color=(1.0, 0.0, 0.0))
    v.display(f1)
    v.fit()
    v.save('face_filling.png')
    v.clear()
Ejemplo n.º 4
0
 def test_filling(self):
     e1 = cm.spline([(0.0, 0.0, 0.0),
                     (1.0, 0.2, 0.3),
                     (1.5, 0.8, 1.0),
                     (0.8, 1.2, 0.2),
                     (0.0, 1.0, 0.0)])
     e2 = cm.spline([(0.0, 0.0, 0.0),
                     (-1.0, 0.2, 0.3),
                     (-1.5, 0.8, 1.0),
                     (-0.8, 1.2, 0.2),
                     (0.0, 1.0, 0.0)])
     w1 = cm.wire([e1, e2])
     f1 = cm.filling(w1)
     # empirical
     self.assert_(close(5.479, f1.area(), 0.01))  # Can vary
Ejemplo n.º 5
0
 def test_spline(self):
     pts = [(0.0, 0.0, 0.0),
            (0.2, 0.1, 0.0),
            (0.5, 0.2, 0.0),
            (-0.5, 0.3, 0.0)]
     e1 = cm.spline(pts)
     # empirical
     self.assert_(close(1.864, e1.length(), 0.001))
Ejemplo n.º 6
0
 def test_spline(self):
     pts = [(0.0, 0.0, 0.0),
            (0.2, 0.1, 0.0),
            (0.5, 0.2, 0.0),
            (-0.5, 0.3, 0.0)]
     e1 = cm.spline(pts)
     # empirical
     self.assert_(close(1.864, e1.length(), 0.001))
Ejemplo n.º 7
0
def edge_spline():
    pts = [(0.0, 0.0, 0.0), (0.2, 0.1, 0.0), (0.5, 0.2, 0.0), (-0.5, 0.3, 0.0)]
    e1 = cm.spline(pts)
    v.viewstandard(viewtype='top')
    v.display(e1, (0.0, 0.0, 0.0))
    for pt in pts:
        v.display(cm.vertex(pt), (1.0, 0.0, 0.0))
    v.fit()
    v.save('edge_spline.png')
    v.clear()
Ejemplo n.º 8
0
def face_filling():
    e1 = cm.spline([(0.0, 0.0, 0.0),
                      (1.0, 0.2, 0.3),
                      (1.5, 0.8, 1.0),
                      (0.8, 1.2, 0.2),
                      (0.0, 1.0, 0.0)])
    e2 = cm.spline([(0.0, 0.0, 0.0),
                      (-1.0, 0.2, 0.3),
                      (-1.5, 0.8, 1.0),
                      (-0.8, 1.2, 0.2),
                      (0.0, 1.0, 0.0)])
    w1 = cm.wire([e1, e2])
    f1 = cm.filling(w1)
    v.viewstandard(viewtype='iso')
    v.display(w1, color=(1.0, 0.0, 0.0))
    v.display(f1)
    v.fit()
    v.save('face_filling.png')
    v.clear()
Ejemplo n.º 9
0
def edge_spline():
    pts = [(0.0, 0.0, 0.0),
           (0.2, 0.1, 0.0),
           (0.5, 0.2, 0.0),
           (-0.5, 0.3, 0.0)]
    e1 = cm.spline(pts)
    v.viewstandard(viewtype='top')
    v.display(e1, (0.0, 0.0, 0.0))
    for pt in pts:
        v.display(cm.vertex(pt), (1.0, 0.0, 0.0))
    v.fit()
    v.save('edge_spline.png')
    v.clear()