def derived_pipe(): profile = cm.ngon(2.0, 6) e1 = cm.arc(8.0, 0.0, math.pi / 2) e2 = cm.segment((0.0, 8.0, 0.0), (-8.0, 8.0, 0.0)) spine = cm.wire([e1, e2]) spine.translate((-8.0, 0.0, 0.0)) spine.rotatex(math.pi / 2) s1 = cm.pipe(profile, spine) save_iso(s1, 'derived_pipe.png')
def test_pipe(self): profile = cm.ngon(2.0, 6) e1 = cm.arc(8.0, 0.0, math.pi / 2) e2 = cm.segment((0.0, 8.0, 0.0), (-8.0, 8.0, 0.0)) spine = cm.Wire([e1, e2]) spine.translate((-8.0, 0.0, 0.0)) spine.rotatex(math.pi / 2) s1 = cm.pipe(profile, spine) # empirical self.assert_(close(213.732, s1.volume(), 0.001))
def test_pipe(self): profile = cm.ngon(2.0, 6) e1 = cm.arc(8.0, 0.0, math.pi / 2) e2 = cm.segment((0.0, 8.0, 0.0), (-8.0, 8.0, 0.0)) spine = cm.wire([e1, e2]) spine.translate((-8.0, 0.0, 0.0)) spine.rotatex(math.pi / 2) s1 = cm.pipe(profile, spine) # empirical self.assert_(close(213.732, s1.volume(), 0.001))