def trms_scale(): s1 = cm.box(1.0, 2.0, 3.0) s2 = cm.scaled(s1, 2.0, 1.0, 1.0) s2.translate((4.0, 0.0, 0.0)) v.viewstandard(viewtype='iso') v.display(s1, (1.0, 0.0, 0.0)) v.display(s2, (0.0, 0.0, 1.0)) v.fit() v.save('trms_scale.png') v.clear()
def test_scaled(self): s1 = cm.box(1.0, 2.0, 3.0) s2 = cm.scaled(s1, 2.0, 3.0, 4.0) v2 = (1.0 * 2.0) * (2.0 * 3.0) * (3.0 * 4.0) self.assert_(close(v2, s2.volume()))